Hi there
I using combo box as input to run the query and to show the result on the on the form, using subform feature (not sure correct approach)
The only problem, when I select the value from using combo box the values on the subform does not change automatically even after pressing the run query button (code below), therefore, every time, i need to press F5 function button
I am not sure, I am doing right as I am closing DoCmd command to close the query, otherwise, Access Open Query Separately..... (which i don't want as I need result on the form)
Thanks in advance
Following are the code
Private Sub Yearlisting_Click()
On Error GoTo Err_Yearlisting_Click
Dim stDocName As String
stDocName = "AddNewYearQuery"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.Close
Exit_Yearlisting_Click:
Exit Sub
Err_Yearlisting_Click:
MsgBox Err.Description
Resume Exit_Yearlisting_Click
End Sub
I using combo box as input to run the query and to show the result on the on the form, using subform feature (not sure correct approach)
The only problem, when I select the value from using combo box the values on the subform does not change automatically even after pressing the run query button (code below), therefore, every time, i need to press F5 function button
I am not sure, I am doing right as I am closing DoCmd command to close the query, otherwise, Access Open Query Separately..... (which i don't want as I need result on the form)
Thanks in advance
Following are the code
Private Sub Yearlisting_Click()
On Error GoTo Err_Yearlisting_Click
Dim stDocName As String
stDocName = "AddNewYearQuery"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.Close
Exit_Yearlisting_Click:
Exit Sub
Err_Yearlisting_Click:
MsgBox Err.Description
Resume Exit_Yearlisting_Click
End Sub