Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiple Queries in Access
Message
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00501255
Message ID:
00501330
Vues:
16
>Hi,
>I Have my VB hooked up to Access and am trying to use multiple criteria searching one table. There is probably a simple answer I just can't find it. The code so far is:
>
>
>Dim CurrentSalary As String
>Dim EducationLevel As String
>Dim JobSector As String
>
>CurrentSalary = SearchCVresults.Combo9.Text
>EducationLevel = SearchCVresults.Combo10.Text
>JobSector = SearchCVresults.Combo11.Text
>
>Data1.RecordSource = "SELECT * FROM CV WHERE Salary = '" & CurrentSalary & "' & EducationLevel = '" & EducationLevel & "' & JobSector = '" & JobSector & "' "
>
>
>I've tried to use the FindFirst/Next/Last method aswell but that doesn't seem to be working either. PLEEASE HELP ME!

The semi-colon won't changed anything. You need to add the AND keyword (instead of the & sign) between each condition like this:
Data1.RecordSource = "SELECT * FROM CV WHERE Salary = '" & CurrentSalary & "' AND EducationLevel = '" & EducationLevel & "' AND JobSector = '" & JobSector & "' "
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform