A
ADB_Seeker
1) I have a combo box that I want to use to create the content for a report
and then have the combo box open the report. My strWhere code is returning a
compile error: Variable Not Defined. What needs changing to make this work?
2) Can I open the report directly from the combo box instead of adding
another command to open the report after the combo box content is selected?
3) How do I get the combo box to automatically remove the previous
selection when I return to the form?
4) Will this work on a bound form?
Following is my code (The table name is ASSIGNEES):
Private Sub cboSpecEObyAssignee_Change()
On Error GoTo Err_cboSpecEObyAssignee_Change
Dim stDocName As String
stDocName = "rptSpecEObyAssignee"
strWhere = "[ASSIGNEE.ID]=" & Me![ASSIGNEE-NAMES]
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
Exit_cboSpecEObyAssignee_Change:
Exit Sub
Err_cboSpecEObyAssignee_Change:
MsgBox Err.Description
Resume Exit_cboSpecEObyAssignee_Change
End Sub
and then have the combo box open the report. My strWhere code is returning a
compile error: Variable Not Defined. What needs changing to make this work?
2) Can I open the report directly from the combo box instead of adding
another command to open the report after the combo box content is selected?
3) How do I get the combo box to automatically remove the previous
selection when I return to the form?
4) Will this work on a bound form?
Following is my code (The table name is ASSIGNEES):
Private Sub cboSpecEObyAssignee_Change()
On Error GoTo Err_cboSpecEObyAssignee_Change
Dim stDocName As String
stDocName = "rptSpecEObyAssignee"
strWhere = "[ASSIGNEE.ID]=" & Me![ASSIGNEE-NAMES]
DoCmd.OpenReport stDocName, acViewPreview, , strWhere
Exit_cboSpecEObyAssignee_Change:
Exit Sub
Err_cboSpecEObyAssignee_Change:
MsgBox Err.Description
Resume Exit_cboSpecEObyAssignee_Change
End Sub