Oliver2003
Technical User
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.
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.