Placing Cursor in Specific Textbox For Each New Record

  • Thread starter DataDiva via AccessMonster.com
  • Start date
D

DataDiva via AccessMonster.com

Good Morning,

I have a form that is used to track quality data throughout a manufacturing
process. My fields consist of:

Today's_Date - Auto generated
Job_Number - Textbox
Department - Combo box
Customer - Textbox -
Assembly_Number - Textbox
RoHS - Textbox
Serial_Number - textbox
Inspector_ID - Combo box
Previous_Operator - Combo box
Job_Function - Combo box
Process - Combo box
Defect_Present - Combo box

I have a command button at the end of the form Named Save_and_Clear. This
button saves the current record and auto-populates the new record with all of
the information that is previously on the form with the exception of
Serial_Number and Defects_Present. Since the rest of the information is
unlikely to change until the user moves on to a new job, these are the only
fields that will need to be entered after the first initial record. I would
like to have the cursor automatically start in the Serial_Number field after
the first record is saved. This way the user could just scan in the serial
number and would not have to tab or use the mouse to get to that field. I
hope I have provided enough info; any help is always appreciated!

Thanks,

Courtney
 
D

DataDiva via AccessMonster.com

I appreciate your fast reply. This bit of code works fine but, is there
anyway to setfocus once you save the record so the cursor will be in the
Serial_Number field for the following record? I'm not sure how to do this.
Thanks!
 
F

fredg

I appreciate your fast reply. This bit of code works fine but, is there
anyway to setfocus once you save the record so the cursor will be in the
Serial_Number field for the following record? I'm not sure how to do this.
Thanks!

Code the Form's Current event:
Me![ControlName].SetFocus
 
D

DataDiva via AccessMonster.com

Hi Fred,

The code works great, thank you! Is there a way to set the cursor to the
first field in the form on open and than have the code you posted work when
the user enters a new record?
 
L

Linq Adams via AccessMonster.com

Private Sub Form_Current()
If Me.NewRecord Then
Me.Serial_Number.SetFocus
Else
Me.FirstControlName.SetFocus
End If
End Sub
 

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