Input mask

aneats

Registered User.
Local time
Today, 09:41
Joined
Nov 13, 2002
Messages
70
I have created form on which users enter payment details, and i want to put some kind of input mask on the form to prevent the following... for instance: i would like the user not to be able to change the value of the field 'status' to PC (Project complete) whilst the 'balance' field on an application is a figure other than £0.
can anyone help me to do this?
thanks
 
In the On Got Focus event of the Status field put something like...
Code:
If Me.Balance <> 0 Then
Msgbox "The balance must be 0"
End if

IMO
 
Last edited:
That will give a message box. To then prevent them from changing it, put the following line right below the messagebox

me!status.locked = true


You will then need some code to Unlock the status field if the balance is equal to zero


If Me.Balance <> 0 Then
Msgbox "The balance must be 0"
me!status.locked = true
else
me!status.locked = false
End if


That should take care of it in a basic sense
 
I have tried this and it doesn't work completely, you see the 'status' field can be set to 'PC' , 'AS', 'SD' or 'WD', and i only want the input mask on the field when the user tries to enter 'PC' and the value in 'balance' is zero. the user can enter 'AS', 'SD' or 'WD' in to this field...

can you help?
 
In the OnCurrent event of the Form...
Code:
If Me.Balance = 0 and Me.Status = "PC" Then
Msgbox "The balance cannot be 0 when entering PC"
Me.Balance.SetFocus
Me.Status.SetFocus
End if

IMO
 
Last edited:

Users who are viewing this thread

Back
Top Bottom