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

Calling a Field from a Query

Status
Not open for further replies.

LittleMan22

Technical User
Jun 24, 2001
46
0
0
CA
How do you call a field from a query? I want to set the value of one of my text-boxes on a form (field = remarks1) to equal the value of a field in a query (field = policyID) in the form's onload event procedure?

Ryan.
 
The normal way is to forget onload events.

A bound textbox will automatically display the field you specify from the underlying form recordsource. So why not include the field in this recordset? Just join it or even union it in.

Presumably there is something else going on in your dialogue which you don't see as related to this box. But it must have some relationship otherwise you wouldn't be displaying it. Note it doesn't matter if the value of this field is the same for all records in the recordsource. mike.stephens@bnpparibas.com
 
The problem is that the field that I want to bring in isn't in the recordsouce...and it would be really complicated to link it together (they are big and distinct queries).

The bound textbox (remarks) is part of a form that has the question "does the client have any existing policies?". What I want to do is, if we have policies stored for this client in our database, copy them into the 'Remarks' textbox...

I can't simply call the field "policy" because there can be multiple entiries (hence the need for a specific query). So what I want to do, to keep things easy, is simply call the field (PolicyID) from the query and have this value (if there is one) populate the 'remarks' textbox....

How do you do this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top