A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Placing Cursor in Specific Textbox For Each New Record



 
 
Thread Tools Display Modes
  #1  
Old February 20th, 2009, 02:16 PM posted to microsoft.public.access.gettingstarted
DataDiva via AccessMonster.com
external usenet poster
 
Posts: 29
Default 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  
Old February 20th, 2009, 03:51 PM posted to microsoft.public.access.gettingstarted
Ron2006
external usenet poster
 
Posts: 936
Default Placing Cursor in Specific Textbox For Each New Record

In the beforeInsert event use

me.fieldname.setfocus
  #3  
Old February 20th, 2009, 04:30 PM posted to microsoft.public.access.gettingstarted
DataDiva via AccessMonster.com
external usenet poster
 
Posts: 29
Default 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  
Old February 20th, 2009, 04:58 PM posted to microsoft.public.access.gettingstarted
fredg
external usenet poster
 
Posts: 4,386
Default 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  
Old February 20th, 2009, 08:47 PM posted to microsoft.public.access.gettingstarted
DataDiva via AccessMonster.com
external usenet poster
 
Posts: 29
Default 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  
Old February 21st, 2009, 02:58 PM posted to microsoft.public.access.gettingstarted
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default 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  
Old February 23rd, 2009, 01:42 PM posted to microsoft.public.access.gettingstarted
DataDiva via AccessMonster.com
external usenet poster
 
Posts: 29
Default 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  
Old February 24th, 2009, 01:53 AM posted to microsoft.public.access.gettingstarted
Linq Adams via AccessMonster.com
external usenet poster
 
Posts: 1,474
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.