How to create code

N

Nora

I want 3 fields for my query criteria in a Form.
Field1 "Code"
Field2 "Reg. No."
Field3 "Part"

E.g. :
Code = "GQ" or "MQ" or "SQ" (2 letters only)
Reg. No. = "7687" or "112" (4 or 3 digits)
Part = "A" or "AB" (1 or 2 letters)

Input data = "GQ" + "7687" Only = (Result shows 2 records)
OR
Input data = "GQ" + "7687" + "A" Only = (Result shows exact 1 record)

My plan is to make the "Part" textbox as an optional input.
So that any1 who know exact data may enter otherwise leave it empty.

Can any1 please help me with this? Thanks.
 
T

Tom van Stiphout

On Wed, 28 Oct 2009 05:31:01 -0700, Nora

Perhaps you could use the LIKE keyword and a wildcard. Your query1
would then be:
select *
from myTable
where Code='GQ' and RegNo=7687 and Part like '*'
whereas the same where-clause in the second query would be:
where Code='GQ' and RegNo=7687 and Part like 'A'

HTH,

-Tom.
Microsoft Access MVP
 
N

Nora

ok, those words should be in my query SQL. I should write anything else in my
Form Coding?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top