Hello all,
I'm having difficulties with what should be a simple open form command. My goal is to open frmVendor on the same record as cldVendorDS in the dblClick event of tboVendorName. frmVendor is in form view and cldVendorDS is in data sheet view as well as a subform on frmFilterVendor. Both frmVendor and cldVendorDS use tblVendor as their record source.
I'm using the following code, but getting strange results.
Code:
Private Sub tboVendorName_DblClick(Cancel As Integer)Dim sWHERE As String
sWHERE = "[VendorID] = " & Me.VendorID
DoCmd.OpenForm "frmVendor", , , sWHERE
End Sub
frmVendor does open, but on record 2. Record 1 is the record i'm trying to open to. The other strange part is none of the other records are there. There is only record 1, the record I wish to open to and record 2, a new record and the one that opens with my event.
Please let me know if you see where I've gone wrong with my code.
Thank you for looking,
John