I have a form for project information in which the primary key is manually entered. The command button I have set up to open this form filters the form to show only projects that the user is a part of. If a user isn't a part of any of the projects in the database this comes up as a blank new form.
I'm trying to figure out some code to say "If user <> partofproject then do not open this form, msgbox 'you do not have any projects at this time'." (this is of course just an explanation).
Here is the code to open the form if it helps:
Private Sub butMyProjects_Click()
DoCmd.OpenForm "frmProjectInfo", acNormal, , "Detailer1 = '" & Me.txtUser & "' OR Detailer2 = '" & Me.txtUser & "' OR Detailer3 = '" & Me.txtUser & "' OR Detailer4 = '" & Me.txtUser & "' OR Detailer5 = '" & Me.txtUser & "' OR Detailer6 = '" & Me.txtUser & "' OR Scheduler1 = '" & Me.txtUser & "' OR Scheduler2 = '" & Me.txtUser & "' OR OutsideDetailer = '" & Me.txtUser & "'", acFormEdit, acWindowNormal
End Sub