'Or' Criteria ???

Steve_God

Registered User.
Local time
Today, 00:37
Joined
Dec 3, 2002
Messages
17
hi,

I wish to create a criteria for a query that can have multiple inputs.

i want to to have "Please enter 'user ID' or Surname" as the thing to enter, so that the person imputting the data can type in either '3' as the user id or 'Smith' for the surname.
If user id 3 had the surname of smith, if could go to the same thing.

Is this possible, if so how?
and would it involve using VB?

Thanks.

Steve
 
It didn't really help, but thanks anyway.
I think i was just very bad at explaining what i wanted...

*tries again* :)

In the criteria box in a query, if you put [Enter User ID], when running it a box pops up asking you to enter user id, same thing happens if you ask [insert surname],

but is there anyway of answering both in one criteria, eg [Enter ID or Surname] so that it would pop up and you could enter 45 or Smith, and because Smith is 45, you'd get the same thing.

Thanks

Steve :)
 
Try this setting in a new column in the query grid (using the correct field names):-

Field: IIf(IsNumeric([Enter ID or Surname]),[User ID]=[Enter ID or Surname],[Surname]=[Enter ID or Surname])

Show: uncheck
Criteria: <>False


<>False is one of Access's defaults. It tells Access the IIf expression in the Field: cell is a criterion. If you directly type the IIf expression in the Where Clause of the SQL Statement in SQL View, you don't need to type <>False.
 

Users who are viewing this thread

Back
Top Bottom