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