By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,391 Members | 1,653 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,391 IT Pros & Developers. It's quick & easy.

OnNextRecord

P: n/a
JLM
Ok. Now I have a form where the user enters data. After clicking the "Add
Another Record" button, I want a specific field to have focus. I can't seem
to find the way to do this. What am I missing?

Thanks in advance.
jeff
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Enter this after the last line in the code for your button:
Me!NameOfSpecificField.SetFocus
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"JLM" <je**********@colostate.edu> wrote in message
news:40******@news.ColoState.EDU...
Ok. Now I have a form where the user enters data. After clicking the "Add
Another Record" button, I want a specific field to have focus. I can't seem
to find the way to do this. What am I missing?

Thanks in advance.
jeff

Nov 12 '05 #2

P: n/a
"JLM" <je**********@colostate.edu> wrote in message news:<40******@news.ColoState.EDU>...
Ok. Now I have a form where the user enters data. After clicking the "Add
Another Record" button, I want a specific field to have focus. I can't seem
to find the way to do this. What am I missing?

Thanks in advance.
jeff


try something like this...
Option Compare Database

Private Sub Command4_Click()
On Error GoTo Err_Command4_Click
DoCmd.GoToRecord , , acNewRec
Me.Controls("MyTextField").SetFocus '<---add this line. Substitute
the name of your field

Exit_Command4_Click:
Exit Sub

Err_Command4_Click:
MsgBox Err.Description
Resume Exit_Command4_Click

End Sub
Nov 12 '05 #3

P: n/a
On Tue, 10 Feb 2004 15:59:05 -0700 in comp.databases.ms-access, "JLM"
<je**********@colostate.edu> wrote:
Ok. Now I have a form where the user enters data. After clicking the "Add
Another Record" button, I want a specific field to have focus. I can't seem
to find the way to do this. What am I missing?

Thanks in advance.
jeff

Sub Form_Current()
If Me.NewRecord then
somecontrol.setfocus
end if
End Sub
--
A)bort, R)etry, I)nfluence with large hammer.
Nov 12 '05 #4

P: n/a
JLM
Perfect. This is Exactly what I was after.

Thank you.
JLM
"PC Datasheet" <sp**@nospam.spam> wrote in message
news:jo*******************@newsread1.news.atl.eart hlink.net...
Enter this after the last line in the code for your button:
Me!NameOfSpecificField.SetFocus
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"JLM" <je**********@colostate.edu> wrote in message
news:40******@news.ColoState.EDU...
Ok. Now I have a form where the user enters data. After clicking the "Add Another Record" button, I want a specific field to have focus. I can't seem to find the way to do this. What am I missing?

Thanks in advance.
jeff


Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.