A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

newbee needs help



 
 
Thread Tools Display Modes
  #1  
Old March 11th, 2005, 10:37 PM
tw
external usenet poster
 
Posts: n/a
Default newbee needs help

I have this code in a form on a date field [au from date]. I'm getting an
error message at the "set rs =" statement. The error is that I have too few
parameters. Expected 2. Can anyone tell me what parameters it expects?

Private Sub AU_From_Date_AfterUpdate()
' see if there is a date conflict
' on any other authorizations for same client/procedure
Dim rs As Recordset
Dim strsql As String

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and" & _
"[Au-pk Client id] = Forms![frm clients].[au-fk client id]"

Set rs = CurrentDb.OpenRecordset(strsql)

Do Until rs.EOF
If rs![AU-PK] Me.[AU-PK] Then
If Me.[au from date] = rs![au from date] And Me.[au from date]
= rs![au to date] Then
MsgBox ("Date conflicts with another authorization please
check authorization and fix one of them")
Exit Sub
End If
End If
rs.MoveNext
Loop
End Sub

  #2  
Old March 11th, 2005, 10:50 PM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

One parameter likely is Forms![frm clients].[au-fk client id]. Concatenate
its value into the SQL string (excerpt shown here)
"[Au-pk Client id] = " & Forms![frm clients]![au-fk client id]

The other parameter may be coming from the lack of a space after the word
"and" in your string:
strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and " & _
"[Au-pk Client id] = " & Forms![frm clients]![au-fk client id]

If that isn't it, then check the spelling of the two field names in your
string.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I have this code in a form on a date field [au from date]. I'm getting an
error message at the "set rs =" statement. The error is that I have too
few
parameters. Expected 2. Can anyone tell me what parameters it expects?

Private Sub AU_From_Date_AfterUpdate()
' see if there is a date conflict
' on any other authorizations for same client/procedure
Dim rs As Recordset
Dim strsql As String

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and" & _
"[Au-pk Client id] = Forms![frm clients].[au-fk client id]"

Set rs = CurrentDb.OpenRecordset(strsql)

Do Until rs.EOF
If rs![AU-PK] Me.[AU-PK] Then
If Me.[au from date] = rs![au from date] And Me.[au from date]
= rs![au to date] Then
MsgBox ("Date conflicts with another authorization please
check authorization and fix one of them")
Exit Sub
End If
End If
rs.MoveNext
Loop
End Sub



  #3  
Old March 12th, 2005, 12:41 AM
tw
external usenet poster
 
Posts: n/a
Default

I made the corrections you suggested. I also had a typo in the spelling of
one of the field names. Now my query string looks like this and I'm getting
an error message too few parameters expected 1

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and " & _
"[Au-fk Client id] = " & Forms![frm clients].[AU-FK Client ID]

thanks for you help

"Ken Snell [MVP]" wrote:

One parameter likely is Forms![frm clients].[au-fk client id]. Concatenate
its value into the SQL string (excerpt shown here)
"[Au-pk Client id] = " & Forms![frm clients]![au-fk client id]

The other parameter may be coming from the lack of a space after the word
"and" in your string:
strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and " & _
"[Au-pk Client id] = " & Forms![frm clients]![au-fk client id]

If that isn't it, then check the spelling of the two field names in your
string.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I have this code in a form on a date field [au from date]. I'm getting an
error message at the "set rs =" statement. The error is that I have too
few
parameters. Expected 2. Can anyone tell me what parameters it expects?

Private Sub AU_From_Date_AfterUpdate()
' see if there is a date conflict
' on any other authorizations for same client/procedure
Dim rs As Recordset
Dim strsql As String

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and" & _
"[Au-pk Client id] = Forms![frm clients].[au-fk client id]"

Set rs = CurrentDb.OpenRecordset(strsql)

Do Until rs.EOF
If rs![AU-PK] Me.[AU-PK] Then
If Me.[au from date] = rs![au from date] And Me.[au from date]
= rs![au to date] Then
MsgBox ("Date conflicts with another authorization please
check authorization and fix one of them")
Exit Sub
End If
End If
rs.MoveNext
Loop
End Sub




  #4  
Old March 12th, 2005, 04:29 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

Is Au-fk Client id field a text field? If yes, delimit the value from the
form with ' characters, just as you did for the Au-fk Proc id field just
above it.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I made the corrections you suggested. I also had a typo in the spelling of
one of the field names. Now my query string looks like this and I'm
getting
an error message too few parameters expected 1

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and " & _
"[Au-fk Client id] = " & Forms![frm clients].[AU-FK Client ID]

thanks for you help

"Ken Snell [MVP]" wrote:

One parameter likely is Forms![frm clients].[au-fk client id].
Concatenate
its value into the SQL string (excerpt shown here)
"[Au-pk Client id] = " & Forms![frm clients]![au-fk client
id]

The other parameter may be coming from the lack of a space after the word
"and" in your string:
strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and " &
_
"[Au-pk Client id] = " & Forms![frm clients]![au-fk client
id]

If that isn't it, then check the spelling of the two field names in your
string.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I have this code in a form on a date field [au from date]. I'm getting
an
error message at the "set rs =" statement. The error is that I have
too
few
parameters. Expected 2. Can anyone tell me what parameters it expects?

Private Sub AU_From_Date_AfterUpdate()
' see if there is a date conflict
' on any other authorizations for same client/procedure
Dim rs As Recordset
Dim strsql As String

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and" &
_
"[Au-pk Client id] = Forms![frm clients].[au-fk client id]"

Set rs = CurrentDb.OpenRecordset(strsql)

Do Until rs.EOF
If rs![AU-PK] Me.[AU-PK] Then
If Me.[au from date] = rs![au from date] And Me.[au from
date]
= rs![au to date] Then
MsgBox ("Date conflicts with another authorization
please
check authorization and fix one of them")
Exit Sub
End If
End If
rs.MoveNext
Loop
End Sub






  #5  
Old March 14th, 2005, 04:05 AM
tw
external usenet poster
 
Posts: n/a
Default

[au-fk client id] is a number field

"Ken Snell [MVP]" wrote:

Is Au-fk Client id field a text field? If yes, delimit the value from the
form with ' characters, just as you did for the Au-fk Proc id field just
above it.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I made the corrections you suggested. I also had a typo in the spelling of
one of the field names. Now my query string looks like this and I'm
getting
an error message too few parameters expected 1

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and " & _
"[Au-fk Client id] = " & Forms![frm clients].[AU-FK Client ID]

thanks for you help

"Ken Snell [MVP]" wrote:

One parameter likely is Forms![frm clients].[au-fk client id].
Concatenate
its value into the SQL string (excerpt shown here)
"[Au-pk Client id] = " & Forms![frm clients]![au-fk client
id]

The other parameter may be coming from the lack of a space after the word
"and" in your string:
strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and " &
_
"[Au-pk Client id] = " & Forms![frm clients]![au-fk client
id]

If that isn't it, then check the spelling of the two field names in your
string.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I have this code in a form on a date field [au from date]. I'm getting
an
error message at the "set rs =" statement. The error is that I have
too
few
parameters. Expected 2. Can anyone tell me what parameters it expects?

Private Sub AU_From_Date_AfterUpdate()
' see if there is a date conflict
' on any other authorizations for same client/procedure
Dim rs As Recordset
Dim strsql As String

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and" &
_
"[Au-pk Client id] = Forms![frm clients].[au-fk client id]"

Set rs = CurrentDb.OpenRecordset(strsql)

Do Until rs.EOF
If rs![AU-PK] Me.[AU-PK] Then
If Me.[au from date] = rs![au from date] And Me.[au from
date]
= rs![au to date] Then
MsgBox ("Date conflicts with another authorization
please
check authorization and fix one of them")
Exit Sub
End If
End If
rs.MoveNext
Loop
End Sub







  #6  
Old March 14th, 2005, 06:20 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

Put a breakpoint on the code step just after you set the value of strsql.
Then, when the code pauses, in the Immediate Window, type this expression
and then press Enter:

?strsql

Copy the string exactly as it prints and post it here.. something in this
string is not what you think it is or should be.

--

Ken Snell
MS ACCESS MVP


"tw" wrote in message
...
[au-fk client id] is a number field

"Ken Snell [MVP]" wrote:

Is Au-fk Client id field a text field? If yes, delimit the value from the
form with ' characters, just as you did for the Au-fk Proc id field just
above it.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I made the corrections you suggested. I also had a typo in the spelling
of
one of the field names. Now my query string looks like this and I'm
getting
an error message too few parameters expected 1

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and "
& _
"[Au-fk Client id] = " & Forms![frm clients].[AU-FK Client
ID]

thanks for you help

"Ken Snell [MVP]" wrote:

One parameter likely is Forms![frm clients].[au-fk client id].
Concatenate
its value into the SQL string (excerpt shown here)
"[Au-pk Client id] = " & Forms![frm clients]![au-fk
client
id]

The other parameter may be coming from the lack of a space after the
word
"and" in your string:
strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and
" &
_
"[Au-pk Client id] = " & Forms![frm clients]![au-fk
client
id]

If that isn't it, then check the spelling of the two field names in
your
string.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I have this code in a form on a date field [au from date]. I'm
getting
an
error message at the "set rs =" statement. The error is that I have
too
few
parameters. Expected 2. Can anyone tell me what parameters it
expects?

Private Sub AU_From_Date_AfterUpdate()
' see if there is a date conflict
' on any other authorizations for same client/procedure
Dim rs As Recordset
Dim strsql As String

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "'
and" &
_
"[Au-pk Client id] = Forms![frm clients].[au-fk client
id]"

Set rs = CurrentDb.OpenRecordset(strsql)

Do Until rs.EOF
If rs![AU-PK] Me.[AU-PK] Then
If Me.[au from date] = rs![au from date] And Me.[au from
date]
= rs![au to date] Then
MsgBox ("Date conflicts with another authorization
please
check authorization and fix one of them")
Exit Sub
End If
End If
rs.MoveNext
Loop
End Sub









  #7  
Old March 14th, 2005, 06:21 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

Also, to go along with my just-sent reply, is it possible for the Me![au-fk
proc id] value to contain a ' character?


--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
[au-fk client id] is a number field

"Ken Snell [MVP]" wrote:

Is Au-fk Client id field a text field? If yes, delimit the value from the
form with ' characters, just as you did for the Au-fk Proc id field just
above it.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I made the corrections you suggested. I also had a typo in the spelling
of
one of the field names. Now my query string looks like this and I'm
getting
an error message too few parameters expected 1

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and "
& _
"[Au-fk Client id] = " & Forms![frm clients].[AU-FK Client
ID]

thanks for you help

"Ken Snell [MVP]" wrote:

One parameter likely is Forms![frm clients].[au-fk client id].
Concatenate
its value into the SQL string (excerpt shown here)
"[Au-pk Client id] = " & Forms![frm clients]![au-fk
client
id]

The other parameter may be coming from the lack of a space after the
word
"and" in your string:
strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and
" &
_
"[Au-pk Client id] = " & Forms![frm clients]![au-fk
client
id]

If that isn't it, then check the spelling of the two field names in
your
string.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I have this code in a form on a date field [au from date]. I'm
getting
an
error message at the "set rs =" statement. The error is that I have
too
few
parameters. Expected 2. Can anyone tell me what parameters it
expects?

Private Sub AU_From_Date_AfterUpdate()
' see if there is a date conflict
' on any other authorizations for same client/procedure
Dim rs As Recordset
Dim strsql As String

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "'
and" &
_
"[Au-pk Client id] = Forms![frm clients].[au-fk client
id]"

Set rs = CurrentDb.OpenRecordset(strsql)

Do Until rs.EOF
If rs![AU-PK] Me.[AU-PK] Then
If Me.[au from date] = rs![au from date] And Me.[au from
date]
= rs![au to date] Then
MsgBox ("Date conflicts with another authorization
please
check authorization and fix one of them")
Exit Sub
End If
End If
rs.MoveNext
Loop
End Sub









  #8  
Old March 15th, 2005, 05:31 PM
tw
external usenet poster
 
Posts: n/a
Default

I had to make a change to the Forms![frm clients].[AU-FK Client ID] the field
on the form was actually [CL-PK Client ID] but I'm still having problems.

The is the result in the immediate window...

Select * From [CC PCS Authorized Units] Where [Au-fk Proc id] = 'A0080' and
[AU-FK Client ID] = 54

The error I'm getting now is a type mismatch. [AU-FK Proc ID] is text and
[au-fk client id] is number (long)


"Ken Snell [MVP]" wrote:

Also, to go along with my just-sent reply, is it possible for the Me![au-fk
proc id] value to contain a ' character?


--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
[au-fk client id] is a number field

"Ken Snell [MVP]" wrote:

Is Au-fk Client id field a text field? If yes, delimit the value from the
form with ' characters, just as you did for the Au-fk Proc id field just
above it.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I made the corrections you suggested. I also had a typo in the spelling
of
one of the field names. Now my query string looks like this and I'm
getting
an error message too few parameters expected 1

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and "
& _
"[Au-fk Client id] = " & Forms![frm clients].[AU-FK Client
ID]

thanks for you help

"Ken Snell [MVP]" wrote:

One parameter likely is Forms![frm clients].[au-fk client id].
Concatenate
its value into the SQL string (excerpt shown here)
"[Au-pk Client id] = " & Forms![frm clients]![au-fk
client
id]

The other parameter may be coming from the lack of a space after the
word
"and" in your string:
strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and
" &
_
"[Au-pk Client id] = " & Forms![frm clients]![au-fk
client
id]

If that isn't it, then check the spelling of the two field names in
your
string.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I have this code in a form on a date field [au from date]. I'm
getting
an
error message at the "set rs =" statement. The error is that I have
too
few
parameters. Expected 2. Can anyone tell me what parameters it
expects?

Private Sub AU_From_Date_AfterUpdate()
' see if there is a date conflict
' on any other authorizations for same client/procedure
Dim rs As Recordset
Dim strsql As String

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "'
and" &
_
"[Au-pk Client id] = Forms![frm clients].[au-fk client
id]"

Set rs = CurrentDb.OpenRecordset(strsql)

Do Until rs.EOF
If rs![AU-PK] Me.[AU-PK] Then
If Me.[au from date] = rs![au from date] And Me.[au from
date]
= rs![au to date] Then
MsgBox ("Date conflicts with another authorization
please
check authorization and fix one of them")
Exit Sub
End If
End If
rs.MoveNext
Loop
End Sub










  #9  
Old March 15th, 2005, 05:37 PM
tw
external usenet poster
 
Posts: n/a
Default

there is no chance there is a ' in the value of Me![au-fk proc id] the values
can only come from a list

"tw" wrote:

I had to make a change to the Forms![frm clients].[AU-FK Client ID] the field
on the form was actually [CL-PK Client ID] but I'm still having problems.

The is the result in the immediate window...

Select * From [CC PCS Authorized Units] Where [Au-fk Proc id] = 'A0080' and
[AU-FK Client ID] = 54

The error I'm getting now is a type mismatch. [AU-FK Proc ID] is text and
[au-fk client id] is number (long)


"Ken Snell [MVP]" wrote:

Also, to go along with my just-sent reply, is it possible for the Me![au-fk
proc id] value to contain a ' character?


--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
[au-fk client id] is a number field

"Ken Snell [MVP]" wrote:

Is Au-fk Client id field a text field? If yes, delimit the value from the
form with ' characters, just as you did for the Au-fk Proc id field just
above it.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I made the corrections you suggested. I also had a typo in the spelling
of
one of the field names. Now my query string looks like this and I'm
getting
an error message too few parameters expected 1

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and "
& _
"[Au-fk Client id] = " & Forms![frm clients].[AU-FK Client
ID]

thanks for you help

"Ken Snell [MVP]" wrote:

One parameter likely is Forms![frm clients].[au-fk client id].
Concatenate
its value into the SQL string (excerpt shown here)
"[Au-pk Client id] = " & Forms![frm clients]![au-fk
client
id]

The other parameter may be coming from the lack of a space after the
word
"and" in your string:
strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and
" &
_
"[Au-pk Client id] = " & Forms![frm clients]![au-fk
client
id]

If that isn't it, then check the spelling of the two field names in
your
string.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I have this code in a form on a date field [au from date]. I'm
getting
an
error message at the "set rs =" statement. The error is that I have
too
few
parameters. Expected 2. Can anyone tell me what parameters it
expects?

Private Sub AU_From_Date_AfterUpdate()
' see if there is a date conflict
' on any other authorizations for same client/procedure
Dim rs As Recordset
Dim strsql As String

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "'
and" &
_
"[Au-pk Client id] = Forms![frm clients].[au-fk client
id]"

Set rs = CurrentDb.OpenRecordset(strsql)

Do Until rs.EOF
If rs![AU-PK] Me.[AU-PK] Then
If Me.[au from date] = rs![au from date] And Me.[au from
date]
= rs![au to date] Then
MsgBox ("Date conflicts with another authorization
please
check authorization and fix one of them")
Exit Sub
End If
End If
rs.MoveNext
Loop
End Sub










  #10  
Old March 15th, 2005, 05:47 PM
tw
external usenet poster
 
Posts: n/a
Default

I copied the results in the immediate window to the sql query builder window
and it worked just fine. The datatype mismatch seems to be coming from
another part of the statement

Set rs = CurrentDb.OpenRecordset(strsql)

rs is declared as a recordset (dim rs as recordset)
strsql is declared as a string (dim strsql as string)

is CurrentDb correct?



"tw" wrote:

I had to make a change to the Forms![frm clients].[AU-FK Client ID] the field
on the form was actually [CL-PK Client ID] but I'm still having problems.

The is the result in the immediate window...

Select * From [CC PCS Authorized Units] Where [Au-fk Proc id] = 'A0080' and
[AU-FK Client ID] = 54

The error I'm getting now is a type mismatch. [AU-FK Proc ID] is text and
[au-fk client id] is number (long)


"Ken Snell [MVP]" wrote:

Also, to go along with my just-sent reply, is it possible for the Me![au-fk
proc id] value to contain a ' character?


--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
[au-fk client id] is a number field

"Ken Snell [MVP]" wrote:

Is Au-fk Client id field a text field? If yes, delimit the value from the
form with ' characters, just as you did for the Au-fk Proc id field just
above it.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I made the corrections you suggested. I also had a typo in the spelling
of
one of the field names. Now my query string looks like this and I'm
getting
an error message too few parameters expected 1

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and "
& _
"[Au-fk Client id] = " & Forms![frm clients].[AU-FK Client
ID]

thanks for you help

"Ken Snell [MVP]" wrote:

One parameter likely is Forms![frm clients].[au-fk client id].
Concatenate
its value into the SQL string (excerpt shown here)
"[Au-pk Client id] = " & Forms![frm clients]![au-fk
client
id]

The other parameter may be coming from the lack of a space after the
word
"and" in your string:
strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "' and
" &
_
"[Au-pk Client id] = " & Forms![frm clients]![au-fk
client
id]

If that isn't it, then check the spelling of the two field names in
your
string.

--

Ken Snell
MS ACCESS MVP

"tw" wrote in message
...
I have this code in a form on a date field [au from date]. I'm
getting
an
error message at the "set rs =" statement. The error is that I have
too
few
parameters. Expected 2. Can anyone tell me what parameters it
expects?

Private Sub AU_From_Date_AfterUpdate()
' see if there is a date conflict
' on any other authorizations for same client/procedure
Dim rs As Recordset
Dim strsql As String

strsql = "Select * From [CC PCS Authorized Units] Where " & _
"[Au-fk Proc id] = " & "'" & Me![au-fk proc id] & "'
and" &
_
"[Au-pk Client id] = Forms![frm clients].[au-fk client
id]"

Set rs = CurrentDb.OpenRecordset(strsql)

Do Until rs.EOF
If rs![AU-PK] Me.[AU-PK] Then
If Me.[au from date] = rs![au from date] And Me.[au from
date]
= rs![au to date] Then
MsgBox ("Date conflicts with another authorization
please
check authorization and fix one of them")
Exit Sub
End If
End If
rs.MoveNext
Loop
End Sub










 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
newbee - error 3001 Invalid Argument running append query Newbee Adam New Users 3 March 9th, 2005 11:45 PM
Newbee - how to loop through table and delete unwanted records Newbee Adam New Users 2 March 8th, 2005 09:33 PM
newbee grant Charts and Charting 2 September 1st, 2004 09:58 AM
Outlook Forms Newbee Jeff C. Using Forms 1 June 12th, 2004 12:34 AM


All times are GMT +1. The time now is 04:03 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.