Solved Open form to new record (1 Viewer)

Teri Bridges

Member
Local time
Today, 15:32
Joined
Feb 21, 2022
Messages
186
I have a cantact form. This form is used to enter new contacts as well as edit existing contacts. I have also added a go to button which allows the user to select a contact to go to from a list.

Currently my form opens to my first contact. I would like to have the form open to a new record.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 13:32
Joined
Oct 29, 2018
Messages
21,454
Maybe on the Load event.

DoCmd.GoToRecord , , acNewRec
 

GPGeorge

Grover Park George
Local time
Today, 13:32
Joined
Nov 25, 2004
Messages
1,829
I have a cantact form. This form is used to enter new contacts as well as edit existing contacts. I have also added a go to button which allows the user to select a contact to go to from a list.

Currently my form opens to my first contact. I would like to have the form open to a new record.
In the Open event:

DoCmd.GoToRecord ObjectType:=acDataForm,ObjectName:=Me.Name, record:=acNewRec
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:32
Joined
Feb 19, 2002
Messages
43,233
Change the RecordSource of your form to a query with a WHERE clause that references the combo or text box you use for searching.

Select ... From ... Where SomeID = Forms!yourform!SomeID

That way, the form will open to a new record.

In the AfterUpdate event of the search field, add Me.Requery to run the RecordSource query again to find the record you are searching for.
 

Users who are viewing this thread

Top Bottom