Command Button to run query and refresh subform isnt working:
I have two forms (they are essentially the same, just sized differently for different size computer screens):
Frm_Value_Request_Archive
Frm_Value Request_Archive1
The subform on each of these forms is the same:
SF_Value_Request_Arvhice
When I click on the RnRfrshQry command button in the second example below, I get this error message:
Enter Parameter Value: Forms!frm_Value_Request_Ar
chive!Text
24
The command button for frm_Value_Request_Archive DOES WORK:
Frm_Value_Request_Archive
Private Sub cmd_refresh_Click()
On Error GoTo Err_cmd_refresh_Click
Dim stDocName As String
stDocName = "qry_update_Value_Request_
Archive"
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName, acNormal, acEdit
[frm_Value_Request_Archive
subform].Form.Requery
DoCmd.SetWarnings True
Exit_cmd_refresh_Click:
Exit Sub
Err_cmd_refresh_Click:
MsgBox Err.Description
Resume Exit_cmd_refresh_Click
End Sub
For this form (Value_Request_Archive1) the command button DOESNT work:
Private Sub RnRfrshQry_Click()
On Error GoTo Err_RnRfrshQry_Click
Dim stDocName As String
stDocName = "qry_update_Value_Request_
Archive"
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName, acNormal, acEdit
[frm_Value_Request_Archive
1 subform].Form.Requery
DoCmd.SetWarnings True
Exit_RnRfrshQry_Click:
Exit Sub
Err_RnRfrshQry_Click:
MsgBox Err.Description
Resume Exit_RnRfrshQry_Click
End Sub
Start Free Trial