[RESOLVED] 2 Fields in combo box.
Hi,
I have a combo box acting as a filter for a form which contains data from 2 seperate fields using the following SQL code:
SELECT tblData.Field1 FROM tblData GROUP BY tblData.Field1 UNION SELECT tblData.Field2 FROM tblData GROUP BY tblData.Field2;
This combo box works fine in showing the data from both fields and when I select data from Field1 it gives me the correct results in my form. However when I select data from Field2 i get no results.
I currently have the following VB code and was wondering how I would implement Field 2 into it:
If Not IsNull(Me.cboFilter1) Then
strWhere = strWhere & "([Field1] = """ & Me.cboFilter1 & """) AND "
End If
Many thanks.
Re: 2 Fields in combo box.
Re: 2 Fields in combo box.
Its VB 6.3 im using it in MS Access.
Re: 2 Fields in combo box.
That isn't Visual Basic. :)
That is Access VBA (Visual Basic for Applications).
Now I know why your question confused me. Visual Basic doesn't have ListBoxes or Combo boxes that support multiple columns (at least not easily or prettily).
Moved to Office Development.
Re: 2 Fields in combo box.
Re: 2 Fields in combo box.
RESOLVED - Worked this one out. This thread can be deleted.