doran_doran
Registered User.
- Local time
- Today, 00:24
- Joined
- Aug 15, 2002
- Messages
- 349
Hi,
Combo box name: cboApprovalStatus
What Do I need ?
I am trying to apply a password when a value is changed in combo box. I think i have to put the code in afterupdate. I put following code but it's not working well. Now, if the a enduser click on drop down and dont change the value then it should not do anything. If end user change the value to new value then it should prompt end user for password and then change the value. if the password is wrong then the msg box pops up "invalid password" and make no changes in drop down value (meaning old value should stay there).
Any help will be appreciated.
Dianna Goldsberg
- - - - My Code - - - -
Private Sub cboApprovalStatus_AfterUpdate()
Dim cmbBefore2 As String
Dim cmbAfter2 As String
Dim strInput As String, strMsg As String
strMsg = "Enter the Password."
cmbBefore2 = Nz(Me.cboApprovalStatus.OldValue, "Null")
cmbAfter2 = Nz(Me.cboApprovalStatus, "Null")
If cmbBefore2 <> cmbAfter2 Then
MsgBox "Status has changed. Please enter the password."
strInput = InputBox(Prompt:=strMsg, Title:="User Info", XPos:=2000, YPos:=2000)
If strInput = "password" Then
change the value in combo box
Else
MsgBox "Incorrect Password OR Password is vacant"
End If
End If
End Sub
Combo box name: cboApprovalStatus
What Do I need ?
I am trying to apply a password when a value is changed in combo box. I think i have to put the code in afterupdate. I put following code but it's not working well. Now, if the a enduser click on drop down and dont change the value then it should not do anything. If end user change the value to new value then it should prompt end user for password and then change the value. if the password is wrong then the msg box pops up "invalid password" and make no changes in drop down value (meaning old value should stay there).
Any help will be appreciated.
Dianna Goldsberg
- - - - My Code - - - -
Private Sub cboApprovalStatus_AfterUpdate()
Dim cmbBefore2 As String
Dim cmbAfter2 As String
Dim strInput As String, strMsg As String
strMsg = "Enter the Password."
cmbBefore2 = Nz(Me.cboApprovalStatus.OldValue, "Null")
cmbAfter2 = Nz(Me.cboApprovalStatus, "Null")
If cmbBefore2 <> cmbAfter2 Then
MsgBox "Status has changed. Please enter the password."
strInput = InputBox(Prompt:=strMsg, Title:="User Info", XPos:=2000, YPos:=2000)
If strInput = "password" Then
change the value in combo box
Else
MsgBox "Incorrect Password OR Password is vacant"
End If
End If
End Sub