Field Defaults to Next Record

N

Nate

I created a data entry form and I would like 1 of the fields on the form that
is linked to a subform to automatically move to the next record after a date
is entered. Is there a simple way to do this?
 
J

John W. Vinson

I created a data entry form and I would like 1 of the fields on the form that
is linked to a subform to automatically move to the next record after a date
is entered. Is there a simple way to do this?

Yes. Use code like the following in the AfterUpdate event of the textbox.
Assuming that the textbox is named MyTextBox the code would be

Private Sub MyTextBox_AfterUpdate()
Me!MyTextBox.DefaultValue = """" & Me!MyTextBox & """"
End Sub

The four quotemarks before and after get translated to one " each, making the
DefaultValue property a string constant as is required.
 

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