I have a single record form and a datasheet form. How is it possible to sync the record navigation of these forms? It would be nice if when a record is double clicked in the datasheet it causes the other form to show the same record.
I have a single record form and a datasheet form. How is it possible to sync the record navigation of these forms? It would be nice if when a record is double clicked in the datasheet it causes the other form to show the same record.
Is one form a SubForm of the other?
No they are two separate forms, both looking at the same table.
I tired the following code in the on dbl click event:
DoCmd.OpenForm FormName:="Invoice2", WhereCondition:="[InvoiceNo] = " & Me!InvoiceNo
DoCmd.Close acForm, Me.Name
Forms![Invoice2].SetFocus
... but I get an error 3464 on the first of these lines of VBA code.
My guess is your InvoiceNo is a string and not a number. Try:
DoCmd.OpenForm FormName:="Invoice2", WhereCondition:="[InvoiceNo] = '" & Me!InvoiceNo & "'"
Thanks. That was the problem, it works fine now.
Great! Glad we could help.