simeon_rose
12-05-2000, 06:02 AM
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?
Fornatian
12-05-2000, 07:38 AM
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