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

Form control as query field

Status
Not open for further replies.

jcmeyer5

Technical User
Oct 10, 2003
7
US
I have a form that I enter information into a table. I want to calculate 2 queries based on the current record in the form.

I have the whole "using the control as criteria in a form" thing working for me. What I want to do is mark the records with a report ID. The report ID is an autonumber field in the table that auto-generates as I scroll through records in the form. Basically this is what I have tried:

In the query, I put REPORTID:[FORMS]![REPORTHEADER]![REPORTID]. The form is OPEN when I run the query. What I get is a "tab" character, not the numer "1" I expected.

Around half my success in doing this relies on what using the form controls in the query fields, so this is important :)

Thanks in advance.
 
jcmeyer5,

Try naming your expression something different from the name of the control.

HTH,

Ken S.
 
Actually, what I did was pretty DUH.

I have a command button that runs several macros. What I did was set the first macro to SaveRecord. This put the information into the REPORTHEADER table. I then pull the values from there into my query, using the control from the report as a criteria to filter to the correct record in the table.

Simple really. I should stay up to 2am with a 6 pack of Coors more often. I might get more work done!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top