T
tw
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
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