Populating Text Box with Field from Query that is not the Record Source

David Ball

Registered User.
Local time
Tomorrow, 07:35
Joined
Aug 9, 2010
Messages
230
Hi Forum,

I have a report based on a query. I want to populate 6 Text Boxes with Dates from fields in another query. The date fields I want to add will be headings for columns that represent weeks (they change all the time so can’t be hard figures).
The two queries are not really related by any common field. I am not able to get this working because the fields I want are not part of the query that is the Record Source for the Report.

Is there any way that I can do this? Can I change the record source of just the text boxes?

Thanks very much

Dave
 
Use some code and a recordset to get the values from the second query, and set the controls values, (unbound controls).
Place the code in the reports load event.
 
Use DLookup() as your controlsource of the control.
 
Thanks,

GHB, thats all way over my head. I don't know what a record set is. but thanks

ArnelGP, this is a bit over my head too but I will have a look at DLookup

Thanks
 
Tried DLookup. It is way too complicated and very unclear as to what it expects to see in the Criteria...
 
Create a separate subform for the headers so they can have a different RecordSource.

It can be made to look like part of the main form by getting rid of the border on the subformcontrol and the Selectors etc on the subform object itself.

This is a much more efficient solution than a bunch of DLookups.
 

Users who are viewing this thread

Back
Top Bottom