Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add a record in a table and move cursor to first field 2

Status
Not open for further replies.

hawkeye71

Technical User
Feb 9, 2001
45
0
0
US
I am using MS Access 2000.
On a form, I want to place a button, when clicked, it should:
1. add the record to the table
2. Take the focus to the first field in the table (this is not the tab order)
3. the values in the fields do not get cleared once the record is added and the focus is sent to the first field on the form .

Thanks,
Indiana
 
To save the record use the code behind a save button, DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70,

Then to move to a another control do something like

me.txtName.setFocus

To stop the other fields getting cleared you could set their locked property to true

me.txtField.locked = true

Hope this helps
 
Cheers hawkeye71, thats my first star...and one of my first responces too!

Hope it works now
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top