If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Placing Cursor in Specific Textbox For Each New Record
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 -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200902/1 |
#2
|
|||
|
|||
Placing Cursor in Specific Textbox For Each New Record
In the beforeInsert event use
me.fieldname.setfocus |
#3
|
|||
|
|||
Placing Cursor in Specific Textbox For Each New Record
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! -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200902/1 |
#4
|
|||
|
|||
Placing Cursor in Specific Textbox For Each New Record
On Fri, 20 Feb 2009 16:30:21 GMT, DataDiva via AccessMonster.com
wrote: 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 -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#5
|
|||
|
|||
Placing Cursor in Specific Textbox For Each New Record
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? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200902/1 |
#6
|
|||
|
|||
Placing Cursor in Specific Textbox For Each New Record
Private Sub Form_Current()
If Me.NewRecord Then Me.Serial_Number.SetFocus Else Me.FirstControlName.SetFocus End If End Sub -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via http://www.accessmonster.com |
#7
|
|||
|
|||
Placing Cursor in Specific Textbox For Each New Record
Many Thanks, that code was just what I needed!
-Courtney -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200902/1 |
#8
|
|||
|
|||
Placing Cursor in Specific Textbox For Each New Record
Glad we could help, Courtney!
-- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...arted/200902/1 |
Thread Tools | |
Display Modes | |
|
|