mike60smart
Registered User.
- Local time
- Today, 14:53
- Joined
- Aug 6, 2017
- Messages
- 1,914
Hi Everyone
This is a follow on from a previous thread Here
I have Main Form which is Unbound named "Dispatch"
With a Subform named "frmCurrentLoadListsubform"
On the Subform I have a Combobox named "cboStatus"
What I want to be able to do is as follows:-
If the user tries to select a value which is Not Equal to "On Hold" or "Available" then
A Msgbox pops up with the Options of OK or CANCEL informing them they can only select "On Hold" or "Available".
Also If they try to select a value of "Billed" then
An Input Box Pops Up asking them to enter a Password.
If the Password is correct then allow the selection of "Billed"
I have the following code for entering a Password.
I get confused as to where to put the End If's when trying to code these types of process's.
Any help as to the layout / construction of this After Update of cboStatus appreciated.
This is a follow on from a previous thread Here
I have Main Form which is Unbound named "Dispatch"
With a Subform named "frmCurrentLoadListsubform"
On the Subform I have a Combobox named "cboStatus"
What I want to be able to do is as follows:-
If the user tries to select a value which is Not Equal to "On Hold" or "Available" then
A Msgbox pops up with the Options of OK or CANCEL informing them they can only select "On Hold" or "Available".
Also If they try to select a value of "Billed" then
An Input Box Pops Up asking them to enter a Password.
If the Password is correct then allow the selection of "Billed"
I have the following code for entering a Password.
I get confused as to where to put the End If's when trying to code these types of process's.
Any help as to the layout / construction of this After Update of cboStatus appreciated.
Code:
Private Sub cmdMask_Click()
10 On Error GoTo cmdMask_Click_Error
Dim x
20 x = InputBoxDK("Password Required", "Password Required")
30 If x = "" Then End
40 If x = "SCtb0825" Then
50 DoCmd.OpenForm "Administration", acNormal
60 MsgBox "Welcome " & Environ("UserName") & "!", vbExclamation
70 End
80 End If
90 On Error GoTo 0
100 Exit Sub
cmdMask_Click_Error:
110 MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure cmdMask_Click, line " & Erl & "."
End Sub