C
CJ
Hi Groupies.
In A2K3, I have the following code that works fine:
Dim stDocName As String
stDocName = "frmDriversSwampersLabourers"
Visible = False
DoCmd.SelectObject acForm, stDocName
DoCmd.Requery
DoCmd.Maximize
This code is on a command button that hides a pop up form after user input.
The problem is with the requery when I convert this code to A2K.
The parent form is frmDriversSwampersLabourers, the subform is
frmSubDriversSwampersLabourers. In A2K when I run the above code I receive
an error that says "You can't use the ApplyFilter action on this window". I
think it is because it is trying to requery the parent, not the sub.
So, I changed my code to the following:
Dim stDocName As String
stDocName = "frmDriversSwampersLabourers"
Visible = False
DoCmd.SelectObject acForm, stDocName
DoCmd.Maximize
stDocName = "frmSubDriversSwampersLabourers"
DoCmd.SelectObject acForm, stDocName
DoCmd.Requery
However, now I receive the message "The object
'frmSubDriversSwampersLabourers' isn't open."
I must have the subform requeried because the input on the pop up form
controls the sub.
Any suggestions??
Thanks
CJ
In A2K3, I have the following code that works fine:
Dim stDocName As String
stDocName = "frmDriversSwampersLabourers"
Visible = False
DoCmd.SelectObject acForm, stDocName
DoCmd.Requery
DoCmd.Maximize
This code is on a command button that hides a pop up form after user input.
The problem is with the requery when I convert this code to A2K.
The parent form is frmDriversSwampersLabourers, the subform is
frmSubDriversSwampersLabourers. In A2K when I run the above code I receive
an error that says "You can't use the ApplyFilter action on this window". I
think it is because it is trying to requery the parent, not the sub.
So, I changed my code to the following:
Dim stDocName As String
stDocName = "frmDriversSwampersLabourers"
Visible = False
DoCmd.SelectObject acForm, stDocName
DoCmd.Maximize
stDocName = "frmSubDriversSwampersLabourers"
DoCmd.SelectObject acForm, stDocName
DoCmd.Requery
However, now I receive the message "The object
'frmSubDriversSwampersLabourers' isn't open."
I must have the subform requeried because the input on the pop up form
controls the sub.
Any suggestions??
Thanks
CJ