I'm confused. This code works from a button on a form
So why can't I use this in a separate module that is called from the switchboard?
The form opens but always goes to a blank record.
Code:
Private Sub Command0_Click()
Dim intBoatNumber As Integer
intBoatNumber = Nz(DLookup("intGlobalOptionsId", "tblBoat", "accStatus = 'On'"))
DoCmd.OpenForm "Global", acNormal, , "Forms![Global].[intGlobalId]=" & intBoatNumber, acFormEdit, acDialog
Exit Sub
End Sub
The form opens but always goes to a blank record.