Subform: Editing Values in Subform Controls

S

Sharon Berg

I have a form with 1 subform.

The form has several command buttons: Add, Edit, and Copy.
Each command button opens a form.

Three of the text box controls on the subform need to be
edit checked.

I am not sure on which event to place the editing checks
for the subform controls. When the user leaves one of the
controls in the subform and selects one of the command
buttons on the main form, I want the edit checks and any
error messages to display before the form opens. And if
possible prevent the form from opening if an edit check
fails.

Thanks In Advance,
Sharon
 
A

alan

-----Original Message-----
I have a form with 1 subform.

The form has several command buttons: Add, Edit, and Copy.
Each command button opens a form.

Three of the text box controls on the subform need to be
edit checked.

I am not sure on which event to place the editing checks
for the subform controls. When the user leaves one of the
controls in the subform and selects one of the command
buttons on the main form, I want the edit checks and any
error messages to display before the form opens. And if
possible prevent the form from opening if an edit check
fails.

Thanks In Advance,
Sharon
.

On the Before Update property of the text box, use this
code.
If Edit Condition Then
MsgBox " Bad Entry, Try Again"
Me.txtTestBox.Undo
Cancel = True
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top