Adding a new record

hinckleyj

J Hinckley
Local time
Today, 22:23
Joined
Dec 30, 2007
Messages
6
I have created a form and have placed the usual Next, Previous, Close buttons. These all work fine. I have now added a new button to create a new record and selected Record Operation > New Record to perform this. However, when I click this, a blank record is displayed but my cursor will not focus on the field.
How can you force the cursor to a particular field after clicking a button?

Thanks to all,

John H
 
In the event handler for the clicked button, call the .SetFocus method of the control you'd like to have the focus.
Code:
Private Sub cmd1_click()
  ...your click handling code here
  Me.txtGetsFocus.SetFocus
End Sub
 
Hi Lagbolt,
What would be my click handling code?
Also, how do I chose which field gets focus?

Thanks for your reply
John
 
"What would be my click handling code?"

That would be the code you already have in place to take you to a new record, i.e. the code the Access Wizard put behind your button.
 

Users who are viewing this thread

Back
Top Bottom