validation rules on a textbox

simeon_rose

Registered User.
Local time
Today, 14:59
Joined
Nov 4, 2000
Messages
34
hi. i've got a form and on it is a textbox with its control source set as DMax from another field. i have got another textbox with its control source set as one of my tables. i want the user to enter the digit displayed in my DMax textbox into the other textbox but need a validation rule that stops the user from entering any digit other than the one shown. cn you help me with this?
 
Can you not disable the textbox and have an event procedure copy the value from the other form at a given time(e.g.when a new record is created)

Alternatively use this on the BeforeUpdate of the textbox:

If Me.MyTextBox <> Forms!DMaxForm!DMaxTextBox Then
Msgbox "Incorrect Entry, You should enter " & Forms!DMaxForm!DMaxTextBox,0,"Error"
Me.MyTextBox = ""
Me.MyTextBox.SetFocus
End if

You may need to copy this code in other events.

Ian
 

Users who are viewing this thread

Back
Top Bottom