Hello,
I currently have a cmd button on a form with the following code
Code:
Private Sub Command138_Click()
If DLookup("[Permission]", "tbl_user", "[User ID] = " & Forms![frm_cafe entry form]!Text32) = 1 Then
DoCmd.ApplyFilter "", "[User ID] Like ""*"" & [Forms]![frm_cafe entry form]![Text32] & ""*""", ""
DoCmd.OpenQuery "qry_user add to report", acViewNormal, acEdit
DoCmd.GoToControl "Text32"
Me.Text32.Value = "####"
Else
DoCmd.Beep
DoCmd.GoToControl "Text32"
Me.Text32.Value = "####"
End If
End Sub
This is working just fine for me as is but I need to add another layer to this security check. I have a text box (Text32) in the same form that, depending on the time of the day, displays a specific string of text. This text is referring to the meal at that time (breakfast, lunch or dinner)
What I would like is for the command button to first check what the text box is displaying and then continue to check if the user has the necessary permissions in their user field. Example: user clicks on command button; code checks text32 and sees that is displaying "Breakfast"; code then checks userID to see if user has needed permissions; etc.