Al3x
Apr 19 2005, 03:59 AM
After a text field has been entered is it possible to bring up a popup message box saying is this corect Yes or No. If the user clicks Yes the textfield is then clocked and disabled.?
Larry Larsen
Apr 19 2005, 04:21 AM
Hi
Try some like this i the afterupdate event of the textbox:
CODE
Dim strMsg As String
strMsg = "Is the value entered correct..?" + vbCrLf
strMsg = strMsg & "Click Yes to Confirm or No to enter a new value."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Confirm Entry?") <> vbYes Then
Me.TextboxName = ""
Me.TextBoxName.Setfocus
Else
Me.TextboxName.Enable = True
Me.TextboxName.Locked = True
End If
Not tested..
HTH's
twinarp
Apr 19 2005, 04:26 AM
I had a bit of a fiddle in 2002 and I don't know whether this will work in 2000, but try this in the After Update property of the textfield
Private Sub TextField_AfterUpdate()
Dim response As Variant
response = 6
response = MsgBox("Is this Correct?", vbYesNo)
If response = 6 Then
Me.key.SetFocus
Me.TextField.Locked = True
Me.TextField.Enabled = False
Me.TextField.BackStyle = 0
Else
Me.TextField.Locked = False
Me.TextField.Enabled = True
Me.TextField.BackStyle = 1
End If
End Sub
Cheers from OZ. Steve.
Al3x
Apr 19 2005, 05:47 PM
twinarp - You sure:
response = 6
response = MsgBox("Is this Correct?", vbYesNo)
is correct?
Larry Larsen - the code never seems to execute on after update?
twinarp
Apr 22 2005, 02:27 AM
I haven't tried it with the response = 6 line removed, but it worked for me in Version 2002.
I didn't include reactivating the text box on the new record or other changes of state.
Steve.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.