Hello,
I have an option group on the main form that filters what records are displayed on the subform. The option group is named st.
I need to also reorder the columns on the subform if option 3 is chosen. I have to reorder several columns.
I have tried just one to see if it worked. The issue is that it reorders correctly if option 3 is chosen, but it does not reorder back to the original order if option 1 is chosen.
Here is the code. Can anyone tell me what the issue may be?
I have an option group on the main form that filters what records are displayed on the subform. The option group is named st.
I need to also reorder the columns on the subform if option 3 is chosen. I have to reorder several columns.
I have tried just one to see if it worked. The issue is that it reorders correctly if option 3 is chosen, but it does not reorder back to the original order if option 1 is chosen.
Here is the code. Can anyone tell me what the issue may be?
Code:
If st.Value = 3 Then
Forms!Default!NavigationSubform!Company.ColumnOrder = 1
And
Forms!Default!NavigationSubform![Account Number].ColumnOrder = 2
Else If
st.Value = 1 Then
Forms!Default!NavigationSubform!Company.ColumnOrder = 2 And Forms!Default!NavigationSubform![Account Number].ColumnOrder = 1
End If
Forms!Default!NavigationSubform.Requery
Me.Refresh
Comment