schneider_ks
asked on
Command Button to run query and refresh subform isnt working:
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
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
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_
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName, acNormal, acEdit
[frm_Value_Request_Archive
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_
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName, acNormal, acEdit
[frm_Value_Request_Archive
DoCmd.SetWarnings True
Exit_RnRfrshQry_Click:
Exit Sub
Err_RnRfrshQry_Click:
MsgBox Err.Description
Resume Exit_RnRfrshQry_Click
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The Source Object is the same for both forms:
SF_Value_Request_Archive
SF_Value_Request_Archive
ASKER
Sorry, I misspelled the SF in the text of my original request - it should read
"The subform on each of these forms is the same:
SF_Value_Request_Archive"
"The subform on each of these forms is the same:
SF_Value_Request_Archive"
ASKER
Thank you so much - I'm working with queries that I didn't design - it's pretty simple, but I didn't think of this!
<Thank you so much - I'm working with queries that I didn't design - it's pretty simple, but I didn't think of this! >
No problem, glad I could help.
No problem, glad I could help.
select the outer part of the subform
hit F4 to open the property sheet
select the Data tab
* see what is in the Source Object
copy and post here
select the Other tab
* see what is in the Name
copy and post here