houstonbill
Technical User
- Nov 6, 2006
- 92
Have a form that opens with an on current event as follows in order to populate users ID:
Private Sub Form_Current()
Me.BadgeID = DLookup("BadgeId", "qry_User")
Me.Firstname = DLookup("Firstname", "qry_User")
Me.Lastname = DLookup("Lastname", "qry_User")
Me.cc_number = DLookup("cc_number", "qry_User")
End Sub
The form also has an ID # (auto number)which currently populates each time the form is opened. Even if it is closed with no entries, the ID # shows up as a record with no entires. Therefore I want to do another "On Current Event" like follows but I can't seem to figure out how to align it. Or should I use a differnt event? Help would be appreciated.
If Me.NewRecord Then
On Error Resume Next 'It should never occur, just to be sure...
Me!ID.DefaultValue = NZ(DMax("[SuggestionID]", "frm_Suggestions"), 0) + 1
End If
Private Sub Form_Current()
Me.BadgeID = DLookup("BadgeId", "qry_User")
Me.Firstname = DLookup("Firstname", "qry_User")
Me.Lastname = DLookup("Lastname", "qry_User")
Me.cc_number = DLookup("cc_number", "qry_User")
End Sub
The form also has an ID # (auto number)which currently populates each time the form is opened. Even if it is closed with no entries, the ID # shows up as a record with no entires. Therefore I want to do another "On Current Event" like follows but I can't seem to figure out how to align it. Or should I use a differnt event? Help would be appreciated.
If Me.NewRecord Then
On Error Resume Next 'It should never occur, just to be sure...
Me!ID.DefaultValue = NZ(DMax("[SuggestionID]", "frm_Suggestions"), 0) + 1
End If