Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automated query based on two values

Status
Not open for further replies.

kfenner

Technical User
Apr 6, 2003
52
US
Risking wearing out my welcome here, but thought of another question.

Ok, you guys gave me the code which makes a button search for all records in another table with the same value in one field as the current open record. Code is as follows, and it works:

sname String
tblView tableview
q query
endvar

sname=client.Value
q = Query

ANSWER: :pRIV:ANSWER.DB

Contacts.db |Client |Last Name|First Name |Distribution| |Check~sname | Check | Check | Check |
EndQuery

if not q.executeQbe()then
errorshow()
else
tblview.open(":priv:answer")
endif

Is there a way to do the same thing, same code, except add that the "Distribution" field is to equal the value "Y" in the Contacts.db. Basically, you are passing a value from the Client.db to the query of the Contacts.db, but also looking for a specific value in the Contacts.db. The "distribution" field is set up as a Combo field with the values of "N" and "Y" to choose from. I only want to display the "Y" ones. I tried one way, but it gave me an error that the user chose to cancel, and I have no clue what that means.

Maybe, if you can answer this real fast, I won't have time to think up anymore questions! : )
 
Adding the Y after the Check in the Distribution field should do it, if not let me know what type fo field distribution is, logical, altpha etc.


q = Query

ANSWER: :pRIV:ANSWER.DB

Contacts.db |Client |Last Name|First Name |Distribution|
|Check~sname | Check | Check | Check Y |
EndQuery


Always glad to help
Perrin
 
Thanks Perrin. That's what I had done, but I had a typo. Found it, fixed it, and now it works great. I appreciate your patience!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top