Setting the focus or control

TigerGyrlAlly

New Member
Joined
Jun 11, 2003
Messages
18
I have a form, the same one that i've been asking all these questions about and I want the focus to be on one field.

Since the data is being scanned into the form with a handheld scanner and populating the 3 other fields, after each scan I would like to move to the next record - it is a form in tabular design.

I have tried Docmd.GoToControl("Vendorid") and was told that I needed to save the control first.

I also tried Forms!formname!fieldname.Setfocus and that didn't work either.

Any help is appreciated
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Maybe try on the afterupdate event of each field, put code that calls setfocus to the next control.
Like behind control 1 it would say control2.setfocus
 
Upvote 0
Do you want to go to the next record, or a new record? I agree with the AfterUpdate Event. Put it in the last field that gets scanned in.
Try something like:
Code:
DoCmd.GoToRecord , , acNewRec
Me.txtWhatever.SetFocus
HTH,

Russell

p.s. If you want to go to the next record, then use acNext instead of acNewRec.
 
Upvote 0

Forum statistics

Threads
1,221,544
Messages
6,160,432
Members
451,646
Latest member
mmix803

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top