PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Importing data from an Access database and filtering it base on two columns of the table

Reply

Importing data from an Access database and filtering it base on two columns of the table

 
Thread Tools Rate Thread
Old 14-02-2004, 01:28 AM   #1
Dave Hauer
Guest
 
Posts: n/a
Default Importing data from an Access database and filtering it base on two columns of the table


I have a combo box that I am filtering to fill a combo box. Originally, I
had a table with that had two field and the string that I used to filter was
as follows:
strSQL = "SELECT [DienCodes] " & "from Codes " & "WHERE [CodeID] =" & CatID
& " " & "ORDER BY [DienCodes];"

I want to add a nother filer item (WHERE) and have tried the following mod.
to the above string::

strSQL = "SELECT [DienCodes] " & "from Codes " & "WHERE [CodeID] =" & CatID
& " " & "AND" & " " & "[CountryCode] =" & CountryCode & " " & "ORDER BY
[DienCodes];"


and this variation:

strSQL = "SELECT [DienCodes] " & "from Codes " & "WHERE [CodeID] =" & CatID
& " " & "AND" & " " & "WHERE[CountryCode] =" & CountryCode & " " & "ORDER BY
[DienCodes];"

Can you tell me if I am doing something wrong because the above string will
not filter by the twotable field identifiers, CodeID and CountryCode.

Any assistance is greatly appreciated!

DH


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off