A family of Microsoft relational database management systems designed for ease of use.
I think you also need to add:
Me.Filter = ""
Me.FilterOn -= True
to the clear routine
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Currently have a Multiple Field Search Form (Looks @ 3 fields in a query if matches or is Null, txtFiscalYear, cboStoreName, cboItem) that user can use to query and pull data. When user click on a query button on the main form the results show up on a sub-form. In addition, have a Clear Button that clears all the fields for the user to re-enter data to do another query. Query work command button works, however; when I hit the Clear button (clears all the fields) the query button does not seem to work anymore until I close out and reopen the forms.
Using the following VBA code as an event procedure when clicked.
Private Sub cmdbtnQuery_Click()
' Query Command Button
Me.subformStoreItemSearch.Requery
End Sub
Private Sub cmdbtnClear_Click()
'When button is clicked clears the field on the main form
Me.txtFiscalYear = ""
Me.cboStoreName = ""
Me.cboItem = ""
Me.txtItemName = ""
Me.cboStoreLocation = ""
Me.txtState = ""
Me.txtCity = ""
'Requery subform
Me.SubfromStoreItemSearch.Requery
Me.subformStoreItemSearch.SetFocus
DoCmd.GoToRecord , , acLast
Me.txtFicalYear.SetFocus
End Sub
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
I think you also need to add:
Me.Filter = ""
Me.FilterOn -= True
to the clear routine