I am trying to get an onclick event to open a form based on the logged in username from Windows.
The idea is to open either form A or B after I have used DLookup to check a table to see if the user can be found in the table?
If the user is not found in the table then open form B
DoCmd.Minimize
Text19 = DLookup("[username]", "Service", "[windowsname] = text17") Then
DoCmd.OpenForm "Assign ", acNormal, , , , , Me.Number
Else
DoCmd.OpenForm "Manager", acNormal, , , , , Me.Number
End If
The other thing is; I am passing a value from the previous form in which the button was clicked (That value is holding the record number for the record being used)
Private Sub Form_Open(Cance l As Integer)
If Not IsNull(Me.OpenA rgs) Then
Me.Number.Value = Me.OpenArgs
Me.Requery
End If
End Sub
The main purpose is to allow only a select group of people found in the table to submit a request to a particular individual and for those not found in the table submit it to another individual.
Thanks any help will be appreciated
The idea is to open either form A or B after I have used DLookup to check a table to see if the user can be found in the table?
If the user is not found in the table then open form B
DoCmd.Minimize
Text19 = DLookup("[username]", "Service", "[windowsname] = text17") Then
DoCmd.OpenForm "Assign ", acNormal, , , , , Me.Number
Else
DoCmd.OpenForm "Manager", acNormal, , , , , Me.Number
End If
The other thing is; I am passing a value from the previous form in which the button was clicked (That value is holding the record number for the record being used)
Private Sub Form_Open(Cance l As Integer)
If Not IsNull(Me.OpenA rgs) Then
Me.Number.Value = Me.OpenArgs
Me.Requery
End If
End Sub
The main purpose is to allow only a select group of people found in the table to submit a request to a particular individual and for those not found in the table submit it to another individual.
Thanks any help will be appreciated
Comment