unbound text box, Criteria for Query

M

Mike Johnson

I'm using an unbound text box to supply the Criteria for a Query which the field on the table is a number(The Table is read/only). I need to know to pass a String or what ever to this text box in VB.

Example: 20040715 or 20040716

How do I pass this to the query criteria in VB?
 
P

PC Datasheet

Mike,

That's not the way to do it! If you want to set the criteria for one of two
values, you need two unbound textboxes. Then you enter the following in the
query's criteria:

Forms!NameOfYourForm!NameOfTextbox1

In the criteria line under that, enter this:

Forms!NameOfYourForm!NameOfTextbox2

When you enter two lines of criteria, you get the "OR" , ie, the criteria is
what's in the first line OR what's in the second line.

So in your case, if you enter 20040715 in Textbox1 and 20040716 in textbox2,
the criteria is:
20040715 or 20040716

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


Mike Johnson said:
I'm using an unbound text box to supply the Criteria for a Query which the
field on the table is a number(The Table is read/only). I need to know to pass a
String or what ever to this text box in VB.
 

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