I've got a report that, upon opening, opens a form:
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "TableChooser", acNormal, , , acFormPropertySettings, acDialog, ""
End Sub
In the form are 2 combo boxes (one that chooses the record source for the report, the other sets a value of a control in the report.
In the form are also 2 command buttons (OK and cancel).
When OK is pressed:
Private Sub OK_Click()
Reports![Equipment Profile].RecordSource = ComboTable
Reports![Equipment Profile]!EPState = ComboState
DoCmd.Close
End Sub
The program works with the code:
Reports![Equipment Profile].RecordSource = ComboTable
But when the code
Reports![Equipment Profile]!EPState = ComboState
is inserted, there is an error that says "You can't assign a value to this object".
What's wrong?
Private Sub Report_Open(Cancel As Integer)
DoCmd.OpenForm "TableChooser", acNormal, , , acFormPropertySettings, acDialog, ""
End Sub
In the form are 2 combo boxes (one that chooses the record source for the report, the other sets a value of a control in the report.
In the form are also 2 command buttons (OK and cancel).
When OK is pressed:
Private Sub OK_Click()
Reports![Equipment Profile].RecordSource = ComboTable
Reports![Equipment Profile]!EPState = ComboState
DoCmd.Close
End Sub
The program works with the code:
Reports![Equipment Profile].RecordSource = ComboTable
But when the code
Reports![Equipment Profile]!EPState = ComboState
is inserted, there is an error that says "You can't assign a value to this object".
What's wrong?