Solved Open form to new record

Teri Bridges

Member
Local time
Today, 10:27
Joined
Feb 21, 2022
Messages
187
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.
 
Maybe on the Load event.

DoCmd.GoToRecord , , acNewRec
 
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
 
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

Back
Top Bottom