Good morning,
I am attempting to freeze a column is a form's subform. I have a button within the main form that allows the user to change the view of the subform from datasheet to single form view. I've added the code to freeze the subform's column to the change view button, but receive an error when the subform's view is being changed to single form. This makes sense.
My question is how would I verify in an If statement that the subform's view is currently datasheet in the below statement in order to not freeze the first column when changing to single form?
Thanks so much for your assistance
Sydney
I am attempting to freeze a column is a form's subform. I have a button within the main form that allows the user to change the view of the subform from datasheet to single form view. I've added the code to freeze the subform's column to the change view button, but receive an error when the subform's view is being changed to single form. This makes sense.
My question is how would I verify in an If statement that the subform's view is currently datasheet in the below statement in order to not freeze the first column when changing to single form?
Code:
If Forms!Mainform!Subform "Current view is Datasheet" Then
Forms!Mainform!Subform.SetFocus
DoCmd.RunCommand acCmdSubformDatasheet
Else
Forms!Mainform!Subform.SetFocus
DoCmd.RunCommand acCmdSubformDatasheet
DoCmd.RunCommand acCmdFreezeColumn
End If
Thanks so much for your assistance
Sydney