I have two buttons on my main form. One of them is for the users to log feedback and the other is for me to go in and add notes/status updates for that feedback. Both buttons open the same form in Split Form view. I would like to hide specific columns when the users click their button vs myself clicking the admin button. What I have tried: Both buttons open the same form, however before the form is opened a public sub is called which a boolean variable to either true (for the users button) or false (for my button). Then when the on load procedure fires, it checks the variables value and either attempts to hide the columns or does not. Here is that code:
Option Compare Database
Public booFeedback As Boolean
Public Sub FeedBackBoolean1()
booFeedback = False
End Sub
Public Sub FeedBackBoolean2()
booFeedback = True
End Sub
Then when the form itself loads it runs this code:
Private Sub Form_Load()
Call cmdRemoveFilter_Click
If booFeedback = False Then
Me.colPriority.ColumnHidden = True
Me.colWorkEffort.ColumnHidden = True
Me.colStatus.ColumnHidden = True
Me.colDeliveryDate.ColumnHidden = True
Me.colStatusComments.ColumnHidden = True
Else
Me.colPriority.ColumnHidden = False
Me.colWorkEffort.ColumnHidden = False
Me.colStatus.ColumnHidden = False
Me.colDeliveryDate.ColumnHidden = False
Me.colStatusComments.ColumnHidden = False
End If
End Sub
The code runs correctly however the results do not show (the columns that I am looking to hide are not hidden correctly). I have found that if I go into design mode, then close and save, the code works correctly the next time that I run it. However if I click the other button then the results are the same as the last time I ran it. Also, I have put pseudo password on the admin button so that noone can click into it. Not too worried about security as of now, will be down the road.