Command Buttons on form/subform

BillBee

Registered User.
Local time
Today, 10:52
Joined
Aug 31, 2008
Messages
137
I have a situation where I have two fields RankingNo and SpecialNo I have placed 2 command buttons on the form header of the subform to switch between the ranking order and a numeric order (the SpecialNo). This works perfectly on the subform but when I open the main form I get a message "Can't find the Form" I have tried moving the buttons to the Main form with the same result. That includes changing the form name in the code to that of the main form. The forms are linked by the field SpecialSectionID.

Private Sub SpecialNum_Btn_Click()
On Error GoTo Err_SpecialNum_Btn_Click
Forms![Specials Setup for Ranking Subform].OrderBy = "Specials.[SpecialNo]"
Exit_SpecialNum_Btn_Click:
Exit Sub

Err_SpecialNum_Btn_Click:
MsgBox Err.Description
Resume Exit_SpecialNum_Btn_Click

End Sub

Can anyone help with something that will allow me to be able to use these controls when the main and subform are open. Thanks
 

Users who are viewing this thread

Back
Top Bottom