F
Furquhart via AccessMonster.com
Access 2007
I want to use VBA to switch between two subforms on the same main form. Both
subforms are open.
Frm_Master
Frm_Heat_Sub (open active)
Frm_PrizeAttach_sub (open but not active)
My code:
Dim stHeat As String
Dim stDocName As String
Dim stHeatID As String
stDocName = "Qry_AddNewPrizeMatchRecord"
stHeat = Forms!Frm_Master!Frm_Heat_Sub!HeatName
*** Problem area
Forms!Frm_Master!Frm_PrizeAttach_Sub!position.SetFocus
DoCmd.SelectObject acForm, "Forms!Frm_Master!Frm_PrizeAttach_Sub", False
Error: I get an error that the form I want to switch to is not open, but it
is.
*** End problem area
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName (append qry)
DoCmd.SetWarnings True
Any help?
Thanks
Fred
I want to use VBA to switch between two subforms on the same main form. Both
subforms are open.
Frm_Master
Frm_Heat_Sub (open active)
Frm_PrizeAttach_sub (open but not active)
My code:
Dim stHeat As String
Dim stDocName As String
Dim stHeatID As String
stDocName = "Qry_AddNewPrizeMatchRecord"
stHeat = Forms!Frm_Master!Frm_Heat_Sub!HeatName
*** Problem area
Forms!Frm_Master!Frm_PrizeAttach_Sub!position.SetFocus
DoCmd.SelectObject acForm, "Forms!Frm_Master!Frm_PrizeAttach_Sub", False
Error: I get an error that the form I want to switch to is not open, but it
is.
*** End problem area
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName (append qry)
DoCmd.SetWarnings True
Any help?
Thanks
Fred