Ok so call me stupid or whatever but i forgot to code in the second half of the input box in case the user hit the cancel button. My code looks like this
DoCmd.OpenForm "formUserLoginAccess", acNormal
If IsNull(Forms!formUserLoginAccess!txtUSL) = True Then intCaseN = 2
Select Case intCaseN
Case 1
intUSL = Forms!formUserLoginAccess!txtUSL
strForm = InputBox("Please Enter the Name of the form you wish to fill out i.e. EmployeeDaily, EmployeeWeekly, Forecast, OrderRegister, EmployeeInformation")
If intUSL = 1 Then
DoCmd.OpenForm strForm
End If
If intUSL = 2 Then
DoCmd.OpenForm strForm, acNormal, , , acFormEdit And Form!strForm.AllowEdits = False And Form!strForm.AllowDeletions = False
End If
If intUSL = 3 Then
DoCmd.OpenForm strForm, acNormal, , , acFormReadOnly
End If
If intUSL = 4 Then If MsgBox("You do not have sufficient access to this database!", vbOKOnly, "Restricted Access") = vbOK Then DoCmd.Quit
The problem im running into is if i put in the
If strForm = "" Then
End Sub
I get the dreaded required Block If and if i put the Block End If in then I have a select issue. Is there any way for me to do this without completely redoing the select code?
DoCmd.OpenForm "formUserLoginAccess", acNormal
If IsNull(Forms!formUserLoginAccess!txtUSL) = True Then intCaseN = 2
Select Case intCaseN
Case 1
intUSL = Forms!formUserLoginAccess!txtUSL
strForm = InputBox("Please Enter the Name of the form you wish to fill out i.e. EmployeeDaily, EmployeeWeekly, Forecast, OrderRegister, EmployeeInformation")
If intUSL = 1 Then
DoCmd.OpenForm strForm
End If
If intUSL = 2 Then
DoCmd.OpenForm strForm, acNormal, , , acFormEdit And Form!strForm.AllowEdits = False And Form!strForm.AllowDeletions = False
End If
If intUSL = 3 Then
DoCmd.OpenForm strForm, acNormal, , , acFormReadOnly
End If
If intUSL = 4 Then If MsgBox("You do not have sufficient access to this database!", vbOKOnly, "Restricted Access") = vbOK Then DoCmd.Quit
The problem im running into is if i put in the
If strForm = "" Then
End Sub
I get the dreaded required Block If and if i put the Block End If in then I have a select issue. Is there any way for me to do this without completely redoing the select code?