R
Ryan_Thompson
Guest
I have a report that is linked to a form by means of altering unbound text boxes by altering thei controls in the form. It allg oes according to plan, untill I close and reopen the report in the code so that information is saved, or leave the control altered as is and then try to print it; what happens is that for every unbound text box there is a pop up asking for the value of a specific text box, with the previous value as the caption. I sure as hell didn't put that code there so it must have something to do with the docmd. operator. In any case I'm at a loss here....... heres the code
Sub SetReportControls(varFieldName As Variant, conTextBox As Control)
'Check if selection is 'null'
If IsNull(varFieldName) Then 'Blank out the relevant objects
conTextBox.ControlSource = ""
Else 'Write the selected field name to the appropriate objects
conTextBox.ControlSource = varFieldName
End If
End Sub
and here is how it's opened:
DoCmd.OpenReport "Vertical", acDesign
and here is the code calling up the function above:
SetReportControls Forms![input form].VENDOR.Value, _
Reports!Vertical.VENDOR
vertical is the name of the report and vendor is a certain control on the report and form. Any help is awesome
Sub SetReportControls(varFieldName As Variant, conTextBox As Control)
'Check if selection is 'null'
If IsNull(varFieldName) Then 'Blank out the relevant objects
conTextBox.ControlSource = ""
Else 'Write the selected field name to the appropriate objects
conTextBox.ControlSource = varFieldName
End If
End Sub
and here is how it's opened:
DoCmd.OpenReport "Vertical", acDesign
and here is the code calling up the function above:
SetReportControls Forms![input form].VENDOR.Value, _
Reports!Vertical.VENDOR
vertical is the name of the report and vendor is a certain control on the report and form. Any help is awesome