I have a Form named frmCustomerList which is a datasheet view form and what I am trying to do is when I would like to edit a particular customer, I would like to double click on the CustomerID field and have it pull up in the frmCustomers so it can be edited. I found some code that seems like it should work, but when I double click the ID it opens frmCustomers but to no record. Here is the code I put on the dbl Click event of the CustomerID field:
Is there something I need to do on the frmCustomers side to understand what the CustomerID event is trying to do? Any help would be appreciated.
KJ
Code:
Const FORMNAME = "frmCustomers"
Dim ctrl As Control
Dim strCriteria As String
On Error GoTo Err_Handler
Set ctrl = Me.ActiveControl
strCriteria = "[CustomerID] = """ & ctrl & """"
DoCmd.OpenForm "frmCustomers", WhereCondition:=strCriteria
Exit_Here:
Exit Sub
Err_Handler:
MsgBox Err.Description, vbExclamation, "Error"
Resume Exit_Here
Is there something I need to do on the frmCustomers side to understand what the CustomerID event is trying to do? Any help would be appreciated.
KJ