I have a command button on a form that basically copies the current record from a contacts table over to a customer table using an append query. After creating the record, I'd really like for access to open the customers form to that record, but can't seem to get it to work. Here's my code I'm using, which works fine except it opens the customers form to the first record.. not the one created by the query. Any help would really help! Thanks In Advance..
Dim db As Database
Dim qdf As QueryDef
Set db = CurrentDb
Set qdf = db.QueryDefs("qryCreateCustomer"
qdf.Parameters("[paramContactID]" = Me.ContactID
qdf.Execute
Set qdf = Nothing
Set db = Nothing
MsgBox "Customer Created Successfully!", vbOKOnly
DoCmd.OpenForm "Orders by Customer", , , , acEdit
Dim db As Database
Dim qdf As QueryDef
Set db = CurrentDb
Set qdf = db.QueryDefs("qryCreateCustomer"
qdf.Parameters("[paramContactID]" = Me.ContactID
qdf.Execute
Set qdf = Nothing
Set db = Nothing
MsgBox "Customer Created Successfully!", vbOKOnly
DoCmd.OpenForm "Orders by Customer", , , , acEdit