E
efandango
I have some VBA code that works fine on a form button on 'TestForm' (within
the tab page in question), but when i paste the code into the 'On Click'
action of the tab; nothing happens. I get no error message, and the code
doesn't do the job. Is there a limitation for tabs?. Nothing changes; it's as
if the tab had never been clicked.
The Form Structure is:
Testform
frm_Points_Test_A
frm_Points_Test_B
frm_Points_Test_C
My Code for the button: (It's essentially 3 almost identical routines for
resetting 3 forms on another form within the tab page):
Private Sub Points_test_Click()
stDocName = "QRY_Delete_PointsTest_A"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings False 'disable warnings
DoCmd.OpenQuery "QRY_Append_PointsTest_A"
DoCmd.SetWarnings True 'enable warnings
[frm_Points_Test_A].Requery
[frm_Points_Test_A].Form![Combo_Answer_A].Requery
[frm_Points_Test_A].Form![Combo_Answer_A] = "?"
'DoCmd.OpenQuery "QX_Score_Points_Sub_A"
stDocName = "QRY_Delete_PointsTest_B"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings False 'disable warnings
DoCmd.OpenQuery "QRY_Append_PointsTest_B"
DoCmd.SetWarnings True 'enable warnings
[frm_Points_Test_B].Requery
[frm_Points_Test_B].Form![Combo_Answer_B].Requery
[frm_Points_Test_B].Form![Combo_Answer_B] = "?"
'DoCmd.OpenQuery "QX_Score_Points_Sub_A"
stDocName = "QRY_Delete_PointsTest_C"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings False 'disable warnings
DoCmd.OpenQuery "QRY_Append_PointsTest_C"
DoCmd.SetWarnings True 'enable warnings
[frm_Points_Test_C].Requery
[frm_Points_Test_C].Form![Combo_Answer_C].Requery
[frm_Points_Test_C].Form![Combo_Answer_C] = "?"
'DoCmd.OpenQuery "QX_Score_Points_Sub_A"
End Sub
the tab page in question), but when i paste the code into the 'On Click'
action of the tab; nothing happens. I get no error message, and the code
doesn't do the job. Is there a limitation for tabs?. Nothing changes; it's as
if the tab had never been clicked.
The Form Structure is:
Testform
frm_Points_Test_A
frm_Points_Test_B
frm_Points_Test_C
My Code for the button: (It's essentially 3 almost identical routines for
resetting 3 forms on another form within the tab page):
Private Sub Points_test_Click()
stDocName = "QRY_Delete_PointsTest_A"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings False 'disable warnings
DoCmd.OpenQuery "QRY_Append_PointsTest_A"
DoCmd.SetWarnings True 'enable warnings
[frm_Points_Test_A].Requery
[frm_Points_Test_A].Form![Combo_Answer_A].Requery
[frm_Points_Test_A].Form![Combo_Answer_A] = "?"
'DoCmd.OpenQuery "QX_Score_Points_Sub_A"
stDocName = "QRY_Delete_PointsTest_B"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings False 'disable warnings
DoCmd.OpenQuery "QRY_Append_PointsTest_B"
DoCmd.SetWarnings True 'enable warnings
[frm_Points_Test_B].Requery
[frm_Points_Test_B].Form![Combo_Answer_B].Requery
[frm_Points_Test_B].Form![Combo_Answer_B] = "?"
'DoCmd.OpenQuery "QX_Score_Points_Sub_A"
stDocName = "QRY_Delete_PointsTest_C"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings False 'disable warnings
DoCmd.OpenQuery "QRY_Append_PointsTest_C"
DoCmd.SetWarnings True 'enable warnings
[frm_Points_Test_C].Requery
[frm_Points_Test_C].Form![Combo_Answer_C].Requery
[frm_Points_Test_C].Form![Combo_Answer_C] = "?"
'DoCmd.OpenQuery "QX_Score_Points_Sub_A"
End Sub