ON EXIT

mark curtis

Registered User.
Local time
Today, 01:42
Joined
Oct 9, 2000
Messages
457
Dear All,
Can anyone tell me how on exit of a field I can prompt the user via a message box the following:

CAPITALS = Functionality

The date you have entered will be stored permanantly, please select yes to continue(DATE IS STORED AND FIELD IS LOCKED) or select no to change date(FIELD CAN BE EDITED BUT ONLY THE FIRST TIME THE FIELD IS POPULATED)

Therefore the first time a user populates the field they can change the date but once they select yes they can not touch that field.

Thanks
Mark
 
Create a macro and use the MsgBox action to define type of message box, e.g. Information, Warning! etc. You can also type the message you want your message box to display. Save and close the macro , eg MsgMacro.

Open your form and select the field.

Open the Properties box (right click mouse on the field and select the last option). In the On Exit property enter the name of the macro. There is a drop down menu that lists all of your macros.

This should sort out the message box part of your problem.

If you need to enter a lot of text, ie too much for a macro you can create an unbound pop-up form that contains just a lable to display your text. You can use form properties to make it look like a 'big' message box. If you do this use the Open form macro action instead of the MsgBox macro action.

I would use different forms to control wheather or not someone can write to field.

[This message has been edited by Jon.N (edited 01-16-2001).]
 
You need to add another field to your table call it locked, number: add a text box with that field as it's control source, set default value to zero, visible no,remove label.
In the on current event of your main form
If Me.Locked = 1 Then
Me.YourDateField.Enabled = False
Else:
Me.YourDateField.Enabled = True
End If
Add the following to the lost focus or exit date field
_Exit(Cancel As Integer)
Dim Msg, Style, Title, Response, MyString
Msg = "Do you wish etc? "
Style = vbYesNo + vbExclamation + vbDefaultButton1
Title = "Confirm Date"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then ' User chose Yes.
YournextField.SetFocus
Me.Locked=1
Else:
Cancel=True
DateField.SetFocus

End If

HTH should work
 

Users who are viewing this thread

Back
Top Bottom