Set Cursor Position in first field of new record on form

Solola

Board Regular
Joined
Sep 23, 2003
Messages
73
I'm trying to make the default cursor location the first field of a new form. I have the form's property Data Entry set to Yes, but that didn't do it.

So, I tried the following code on the On Load property of the form, but when I try to load a new record, I get a Compile error: Method or data member not found (and it highlights SetFocus as the error):

Private Sub Form_Load()
Me.nmdp_rid.SetFocus
End Sub

I also tried an if statement to determine if it's a new record before setting the focus, but that doesn't work, either (same error message).

What am I doing wrong?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Well, if you want to pursue it further try to explain exactly what's in the form. I'm not sure but it might have to do with this header/detail setup you have. Maybe the records in the detail are not part of the form per se but acting as if some kind of subform perhaps. Dunno...
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

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