How can I bind textbox to query field regardless of its name?

  • Thread starter Thread starter Max Moor
  • Start date Start date
M

Max Moor

Hi All,
I have a report I want to use for various queries. (the OpenQuery
"report" just doesn't cut it). I'm having trouble binding the vaious text
boxes to the vaious fields of the underlying query.

I tried to set the ControlSource of the text boxes in VB, but... I
can't open the report hidden in design view, because the database will go
out as an MDE file. Past that, I can't set the ControlSource property in
acViewPreview mode.

Is there a way to make this work? I thought maybe I could get tricky
and set the ControlSource properties in their property sheets. I tried
setting them to:

=Me(0)
and
=Reports!rptThisReport(0)

Neither worked, of course. Can anyone put me on the road to
enlightenment???

- Max
 
Max said:
I have a report I want to use for various queries. (the OpenQuery
"report" just doesn't cut it). I'm having trouble binding the vaious text
boxes to the vaious fields of the underlying query.

I tried to set the ControlSource of the text boxes in VB, but... I
can't open the report hidden in design view, because the database will go
out as an MDE file. Past that, I can't set the ControlSource property in
acViewPreview mode.


You can set your controls' ControlSource property in the
report's Open event.
 
You can set your controls' ControlSource property in the
report's Open event.

Doh! Thanks, Marsh. Somewhere along the way, I picked up a technique for
doing it in the opening form, and went blind to everything else. Thanks
again,
Max
 
Back
Top