|
-
Mar 27th, 2007, 07:32 AM
#1
Thread Starter
New Member
[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.
-
Mar 27th, 2007, 08:09 AM
#2
Re: 2 Fields in combo box.
-
Mar 27th, 2007, 08:32 AM
#3
Thread Starter
New Member
Re: 2 Fields in combo box.
Its VB 6.3 im using it in MS Access.
-
Mar 27th, 2007, 08:44 AM
#4
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.
-
Mar 27th, 2007, 08:54 AM
#5
Thread Starter
New Member
Re: 2 Fields in combo box.
-
Mar 27th, 2007, 11:27 AM
#6
Thread Starter
New Member
Re: 2 Fields in combo box.
RESOLVED - Worked this one out. This thread can be deleted.
Last edited by FunkyFlea; Mar 27th, 2007 at 12:49 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|