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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move to New Record when opening a form

Status
Not open for further replies.

cranebill

IS-IT--Management
Jan 4, 2002
1,113
US
I have a form based on a table that i will be using to enter new customers. When it opens right now it immediatley goes to the first record. I have set the properties to Data Entry thinking that may do it, but that did not work either. I have gotten it to work with a query on open but how can you get it to move to enter a new record on open using VBA?

Bill
 
Very simple...

Use the RecordSetClone property of the form. Like this...

Dim rs as DAO.Recordset

Set rs = Me.Recordsetclone
rs.FindFirst "Myfield = " & Myvalue
if not rs.nomatch then Me.bookmark = rs.bookmark

"Me" is the form you are opening.

Gary
gwinn7
A+, N+, I+
 
Put this in the form open event:

DoCmd.GoToRecord , , acLast
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top