Filter by Form Command Button

A

Access Fried

When I filter by form using the tools the filter clears the fields and I can
enter what field I want to filter by and it works fine. So I added a command
button 'Filter by Form' using the wizard and it doesn't work. The event
proceedure on click is:

Option Compare Database
Private Sub Command150_Click()
On Error GoTo Err_Command150_Click
DoCmd.GoToRecord , , acNewRec
Exit_Command150_Click:
Exit Sub
Err_Command150_Click:
MsgBox Err.Description
Resume Exit_Command150_Click
End Sub
Private Sub Command151_Click()
On Error GoTo Err_Command151_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70
Exit_Command151_Click:
Exit Sub
Err_Command151_Click:
MsgBox Err.Description
Resume Exit_Command151_Click
End Sub
Private Sub Command152_Click()
On Error GoTo Err_Command152_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70
Exit_Command152_Click:
Exit Sub
Err_Command152_Click:
MsgBox Err.Description
Resume Exit_Command152_Click
End Sub
Private Sub Command201_Click()
On Error GoTo Err_Command201_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 2, , acMenuVer70
Exit_Command201_Click:
Exit Sub
Err_Command201_Click:
MsgBox Err.Description
Resume Exit_Command201_Click
End Sub

Can anyone help? There seems to be alot of mention of the word error! Please!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top