Switch in a qry

pascaly

Registered User.
Local time
Tomorrow, 01:55
Joined
Jan 29, 2008
Messages
28
Hi all,

I need to use the Switch function in a query.

I have a query that gets the first letter of a Position Number (D, V, C etc. that works fine).

Then, I take that query's results, and use it as a sub query in a second query. I then need to show a value dependant on what is returned in the original query for the first letter.

But when ever I run the query, a Parameter box appears, asking for the value of D (one of the return options). I have used Switch before and also checked out the Switch/Query threads around here (which were helpful) but still can't get it to work.

Can anyone shed some light on this for me?

Here is the Switch as I have it in the query field: row
Role Type: Switch([FirstLetter]=[D],[VPS],[FirstLetter]=,[Unattached],[FirstLetter]=[J],[EO],[FirstLetter]=[C],[Contractor],[FirstLetter]=[H],[Temp],[FirstLetter]=[V],[Secondment])
 
Unless those are fields, they need to be enclosed in quotes:

[FirstLetter]="D"

and perhaps

"VPS"
 
That was quick!

I'll give that a try, thanks.
 
pbaldy! You did it.

It worked first try. Thank very much for your help and that very quick response.

Very much appreciated. :)
 
No problemo; glad it worked for you.
 

Users who are viewing this thread

Back
Top Bottom