Add Record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can I make the form cycle forward to a new blank record as soon as a specific
field is populated with data?

That would be much faster than using the mouse to slide down to the bottom
of the form to click on the "Add Record" button!
 
Can I make the form cycle forward to a new blank record as soon as a specific
field is populated with data?

That would be much faster than using the mouse to slide down to the bottom
of the form to click on the "Add Record" button!

Sure. One way is to use the keyboard Tab key to navigate from field to
field, and make this control the last field in the tab order. If the
form's Cycle property is set to New Record, the record will be saved
and you'll go to the new record.

If you prefer to use the mouse, you can use code in the control's
AfterUpdate event - but you have no guarantee that the user will have
filled in the *OTHER* controls on the form; you may need to put some
validation checks in the Form's BeforeUpdate event. The code would be
something like

Private Sub txtLastControl_AfterUpdate()
' force a save of the record
If Me.Dirty = True Then Me.Dirty = False
' jump to the New Record
DoCmd.GoToRecord acForm,Me.Name, acNewRecord
End Sub

John W. Vinson[MVP]
 
I would prefer to not have to touck any part of the computor. Once the last
field in the tab order has the qualified data, I would like it to save the
record and cycle to a new blank record automatically.
 
I would prefer to not have to touck any part of the computor. Once the last
field in the tab order has the qualified data, I would like it to save the
record and cycle to a new blank record automatically.

Ummmm...

and you don't want to do anything (i.e. touch the computer) to make
this happen?

I'm sorry, you lost me there!

If you're tabbing from field to field, what you describe is the
default action. You don't need to do ANYTHING to make it happen.

John W. Vinson[MVP]
 
I have a scale device (periferal) that sends the weight to the last data
entry field. As soon as that field is populated I would like the form to save
the record and open a blank record for the next animal.
 
I have a scale device (periferal) that sends the weight to the last data
entry field. As soon as that field is populated I would like the form to save
the record and open a blank record for the next animal.

Thank you for the explanation. You *didn't say that* and therefore *I
didn't know that*. Sorry my telepathy was on the blink!

Set the AutoTab property of the textbox to Yes. The scanned value must
be as many characters as the defined size of the field for this to
work.

John W. Vinson[MVP]
 

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

Back
Top