Hello I have an "add new" button on a form. I would like the button to go to a new record AND filter the form on that new record. The form also has an unbound combo box used to look for and filter to existing records. My code for the "add new" button OnClick Event so far (below) removes any existing filter, and goes to a new record, but I would like to have the form filter so only the new record is shown.
I tried adding Me.FilterOn = True after the DoCmd, but this did not work - the form returned to the previous filter.
Any help would be greatly appreciated!
Bridget
Code:
Private Sub btnAddBldg_Click()
On Error GoTo Err_btnAddBldg_Click
If Me.FilterOn = True Then
Me.FilterOn = False
End If
DoCmd.GoToRecord , , acNewRec
Exit_btnAddBldg_Click:
Exit Sub
Err_btnAddBldg_Click:
MsgBox Err.Description
Resume Exit_btnAddBldg_Click
End Sub
Any help would be greatly appreciated!
Bridget
Comment