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

Help with (on page property) printing a report - look up fields

Status
Not open for further replies.

Oliver2003

Technical User
Apr 19, 2003
144
GB
I have a report that has been saved from a form, the report has a combo box (which should really be a text box) which has 6 columns but only displays one which is the ‘name’ . When this combo box is changed or on each record, 4 text boxes are updated with the fields ‘title’, ‘Address’, ‘Telephone’ and ‘Fax’ from the combo box – the code I am using is below:

TxtTitleTo = TxtNameTo.Column(1)
TxtAddressTo = TxtNameTo.Column(3)
TxtTelephoneTo = TxtNameTo.Column(4)
TxtFaxTo = TxtNameTo.Column(5)

This works fine when the report is opened and all controls are filled but what I would like to do is print the report and get it to fill all the controls without opening it first, if I just print it (acnormal) the text boxes fields ‘title’, ‘Address’, ‘Telephone’ and ‘Fax’ are not filled in. The code I am using at the moment to print the report is below:

DoCmd.OpenReport "RptDTFForm", acViewPreview
DoCmd.PrintOut acSelection, , , acHigh, 1, True
DoCmd.Close acReport, "RptDTFForm", acSaveNo

The combo box is based on a table ‘Persondetails’ which has the above fields but the name value is also stored in another table ‘orders’

Is it possible to get the name from the table orders based on the record ID then find the other info title etc in the table Persondetails’ so that the report can be printed without opening it first.

Any help would be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top