Can someone help me on my issues please. I am new to access vba
I have a form named: frmEarlyWarning System
SubForm: frmEarlyWarning SystemSubForm
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:
I made a research already about my issue but then still no luck.
Your help is very much appreciated!
tia
I have a form named: frmEarlyWarning System
SubForm: frmEarlyWarning SystemSubForm
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:
Code:
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
Comment