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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Table based on a form value

Status
Not open for further replies.

RPW1

Technical User
Jun 14, 2001
19
US
I have a form "View" with 2 fields "Dealer" and "Acct" I have various tables that correspond to the value in the dealer field. I want to query that table and find all the records and all fields in that table with the same value as the acct field.
 
You can create a DynasetType recordset to retrieve the records that you are looking for.

DAO Example:

strSQL = "SELECT * FROM tblDealer " & _
WHERE tblTransactions.AcctNum = " & CStr(Me.tbxACCTNum.Value) & ";"

Set drsACCT = <DatabaseObject>.OpenRecordset(strSQL,dbOpenDynaset,dbSeeChanges,dbPessimistic)

Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top