S
S Jackson
I have a subform called fsubSurveyors inserted into a from called frmMaster.
The fsubSurveyors form is based on tblCaseSurveyors. It contains a Combo2
that obtains its information from tblSurveyors.
I want the combo box to display its contents where the field
[tblSurveyors].[Region] = [frmMaster].[Region]
First, where do I put this Event procedure? In the On Enter event of the
Combo2 control on the subform, fsubSurveyors?
So far, I've tried putting the code in the OnEnter event of the Combo2
control on fsumSurveyors:
Private Sub Combo2_Enter()
Dim strSQL As String
strSQL = "Select tblSurveyors.SurveyorID, tblSurveyors.SvyName,
tblSurveyors.SvyTitle," _
& "tblSurveyors.SvyProgram, tblSurveyors.SvyAddress, " _
& "tblSurveyors.SvyCity, tblSurveyors.SvyZip, tblSurveyors.SvyPhone,
tblSurveyors.SvyEmploy " _
& "FROM tblSurveyors " _
& "WHERE tblSurveyors.Region = "frmMaster.Region" _
& "ORDER by tblSurveyors.SvyName; "
Me.Combo2.RowSource = strSQL
End Sub
I am getting a syntax error. I know it is because of my WHERE clause and I
do not know how to fix it. Any help is very much appreciated. Thanks!
S. Jackson
The fsubSurveyors form is based on tblCaseSurveyors. It contains a Combo2
that obtains its information from tblSurveyors.
I want the combo box to display its contents where the field
[tblSurveyors].[Region] = [frmMaster].[Region]
First, where do I put this Event procedure? In the On Enter event of the
Combo2 control on the subform, fsubSurveyors?
So far, I've tried putting the code in the OnEnter event of the Combo2
control on fsumSurveyors:
Private Sub Combo2_Enter()
Dim strSQL As String
strSQL = "Select tblSurveyors.SurveyorID, tblSurveyors.SvyName,
tblSurveyors.SvyTitle," _
& "tblSurveyors.SvyProgram, tblSurveyors.SvyAddress, " _
& "tblSurveyors.SvyCity, tblSurveyors.SvyZip, tblSurveyors.SvyPhone,
tblSurveyors.SvyEmploy " _
& "FROM tblSurveyors " _
& "WHERE tblSurveyors.Region = "frmMaster.Region" _
& "ORDER by tblSurveyors.SvyName; "
Me.Combo2.RowSource = strSQL
End Sub
I am getting a syntax error. I know it is because of my WHERE clause and I
do not know how to fix it. Any help is very much appreciated. Thanks!
S. Jackson