Part of my trouble is also that the terms I need to filter on are multiple words, and I'm really confused about how to correctly refer to things with multiple words that are separated by spaces when I'm working in VB -- when to use [], or _, or " ", etc.
The form is called BID LIST.
The filter is on a control called Status2. The options are:
1. Bid Accepted
2. Submitted Budgetary Bid
3. No Bid
4. Bid Rejected
5. Bid in Process
6. Bid Submitted
7. ...and of course, 'no filter' is another option. (In other words, just open the form).
I tried making just one command button to open the "Bid Submitted" version of the form. Using the command button wizard, I first created the button to open the BID LIST form. This is the code I got:
Private Sub Command13_Click()Then I had the code I've used in the past to create filtering option buttons within a form:
On Error GoTo Err_Command13_Click
Dim stDocName As StringExit_Command13_Click:
Dim stLinkCriteria As String
stDocName = "BID LIST"
DoCmd.OpenForm stDocName, , , stLinkCriteriaExit SubErr_Command13_Click:MsgBox Err.DescriptionEnd Sub
Resume Exit_Command13_Click
BID_List.Filter = "Status2 = Bid Submitted"Of course, I don't know how to deal with the two words Bid Submitted that are already within a quotation-marked statement... ??
BID_List.FilterOn = True
And I couldn't figure out where to insert these two lines in the larger mess of code for opening the form. I tried:
Private Sub Command13_Click()...but I got an error message when I tried out the button ("Object Required"). I have no idea whether the error has to do with the wording, placement, or punctuation of the code I inserted.
On Error GoTo Err_Command13_Click
Dim stDocName As StringExit_Command13_Click:
Dim stLinkCriteria As String
stDocName = "BID LIST"
DoCmd.OpenForm stDocName, , , stLinkCriteria
BID_List.Filter = "Status2 = [Bid Submitted]"
BID_List.FilterOn = TrueExit SubErr_Command13_Click:MsgBox Err.DescriptionEnd Sub
Resume Exit_Command13_Click
Any ideas?
Angi