R
Rocky
I am curently wotking on a customer db.
I have two forms, on with summary information and one with customer
records.
Both are based on the same recordset.
I have written the code below, where I first doulble click on the
CustomerId ("ConId") - Long Integer". I then use the FindFirst below,
to search for the actual cusomer record.
I get a run-time error, "can't recognise ContactId"
When I debug, "ConId" shows the value of the CustomerID.
I have looked at similar posts, but they all seem to refer to text
finds.
Private Sub ConId_DblClick(Cancel As Integer)
Dim rs As DAO.Recordset
If Not IsNull(Me.ConId) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Open Form where Customer Records are kept
DoCmd.OpenForm "CustCard", acNormal, "", "", , acNormal
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[ContactId] = " & Me.ConId
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
End Sub
I have two forms, on with summary information and one with customer
records.
Both are based on the same recordset.
I have written the code below, where I first doulble click on the
CustomerId ("ConId") - Long Integer". I then use the FindFirst below,
to search for the actual cusomer record.
I get a run-time error, "can't recognise ContactId"
When I debug, "ConId" shows the value of the CustomerID.
I have looked at similar posts, but they all seem to refer to text
finds.
Private Sub ConId_DblClick(Cancel As Integer)
Dim rs As DAO.Recordset
If Not IsNull(Me.ConId) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Open Form where Customer Records are kept
DoCmd.OpenForm "CustCard", acNormal, "", "", , acNormal
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[ContactId] = " & Me.ConId
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
End Sub