I have a form named: frmEarlyWarningSystem
SubForm: frmEarlyWarningSystemSubForm
Combox in the mainform: cboLOB
The subform is created using an existing table but then I deleted the Record Source of it because I want to set the Record Source after I click a button and the criteria is based on the combo box. but After Clicking the button, it shows no records. Here is my code:
Expand|Select|Wrap|Line Numbers
- Private Sub cmdGo_Click()
- Dim strSQL As String
- strSQL = "SELECT [Priority],[As_Of],[LOB],[Employee_SID],[Employee_Full_Name],[Level_II_Manager_Full_Name],[Level_I_Manager_Full_Name] from [Priority] WHERE [LOB] = '" & [Forms]![frmEarlyWarningSystem]![cboLOB] & "'"
- With Forms![frmEarlyWarningSystem]![frmEarlyWarningSystemSubForm]
- .Form.RecordSource = strSQL
- .Requery
- End With
- End Sub
Your help is very much appreciated!
tia