G
Guest
Dear all,
I have a form I want a user to be able to use to add new records or edit
existing ones. The user will enter an ID which he will not know if it is an
existing record or not and if it is existing then I'd like the user to see
the previous values but if it is new then I'd like them to see blank fields
to fill. I've set up a Combo box and linked it to the existing IDs using the
standard code:
Private Sub ComboBox_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Value] = '" & Me![ComboBox] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
I want to have a method which sets:
Me.Form.DataEntry = True
If the ID is not in the list. Any advice would be appreciated. As a smaller
question, I'd like the user to see blank values to begin with when the form
loads while just now they see the values of the initial record.
Cheers,
Alasdair
I have a form I want a user to be able to use to add new records or edit
existing ones. The user will enter an ID which he will not know if it is an
existing record or not and if it is existing then I'd like the user to see
the previous values but if it is new then I'd like them to see blank fields
to fill. I've set up a Combo box and linked it to the existing IDs using the
standard code:
Private Sub ComboBox_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Value] = '" & Me![ComboBox] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
I want to have a method which sets:
Me.Form.DataEntry = True
If the ID is not in the list. Any advice would be appreciated. As a smaller
question, I'd like the user to see blank values to begin with when the form
loads while just now they see the values of the initial record.
Cheers,
Alasdair