Hi All!
I have the following code in the on double click event:
Private Sub cboPhyLocation_DblClick(Cancel As Integer)
Dim frm As Form, rst As Recordset
DoCmd.OpenForm "Contact Info"
DoEvents
Set frm = Forms![Contact Info]
Set rst = frm.RecordsetClone
If rst.BOF Then
MsgBox "No Records!"
Else
rst.FindFirst "[ContactID] = " & Me!PhysicalLocation & ""
If rst.NoMatch Then
MsgBox "Record Not Found!"
Else
frm.Bookmark = rst.Bookmark
End If
End If
Set frm = Nothing
Set rst = Nothing
End Sub
If user double clicks the field, the contact form opens correctly to the matching record. If user double clicks the field and it is blank, I would like it to either say "No Records" or open the form so they can add a new record. Either would be fine. But instead I get Error 3077 and the rst.FindFirst "[ContactID] = & Me!PhysicalLocation & "" line.
Thanks
I have the following code in the on double click event:
Private Sub cboPhyLocation_DblClick(Cancel As Integer)
Dim frm As Form, rst As Recordset
DoCmd.OpenForm "Contact Info"
DoEvents
Set frm = Forms![Contact Info]
Set rst = frm.RecordsetClone
If rst.BOF Then
MsgBox "No Records!"
Else
rst.FindFirst "[ContactID] = " & Me!PhysicalLocation & ""
If rst.NoMatch Then
MsgBox "Record Not Found!"
Else
frm.Bookmark = rst.Bookmark
End If
End If
Set frm = Nothing
Set rst = Nothing
End Sub
If user double clicks the field, the contact form opens correctly to the matching record. If user double clicks the field and it is blank, I would like it to either say "No Records" or open the form so they can add a new record. Either would be fine. But instead I get Error 3077 and the rst.FindFirst "[ContactID] = & Me!PhysicalLocation & "" line.
Thanks