By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,107 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,107 IT Pros & Developers. It's quick & easy.

Need some combo advice

P: n/a

I basically have a form with a subform with two combo boxes on the main
form which filter the subform. The code below works except I cant seem
to get it to show all the worksheets when there is nothing in the buyer
combo or status combo. Can someone please advise...thank you.

For ease of naming:

Form X - frm01

Subform - Subf02

Combo Buyer - ByrCombo

Field Buyer - BuyerName

Combo Status - StatusCombo

Field Status - Status

So far the code I have is this:

Private Sub Command19_Click()

Dim stDocName As String

Dim stLinkCriteria As String

stDocName = "frm02"

If Not IsNull(Me!ByrCombo) Then

stLinkCriteria = "[BuyerName]=" & Me!ByrCombo

End If

If IsNull(Me!ByrCombo) Then

stLinkCriteria = "[BuyerName]=" & "*" 'Here I am trying to get it to
show all records if its null

End If

If Not IsNull(Me!StatusCombo) Then

If Len(stLinkCriteria) <> 0 Then

stLinkCriteria = stLinkCriteria & " AND "

End If

stLinkCriteria = stLinkCriteria & "[Status] = " & Me!StatusCombo

[Child0].Requery

End If

End Sub
--
Posted via http://dbforums.com
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Try using "[Fieldname] LIKE '" & strValue & "*'" or something along
those lines. Check www.mvps.org/access for this. I know it's there
in the forms section. look for something like Filter + combobox, and
you should find it.
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.