Open form to blank record

  • Thread starter Thread starter Deb Smith
  • Start date Start date
D

Deb Smith

I want to open a form to a blank record but I do not want to allow
additions.

My form has a list box in the form header that is used to restrict records
shown on the form. When I open the form I want just the list box to show
without all the records from the list box showing below in the form.

Traditionally I have used DoCmd.GoToRecord, "", acNew Record to accomplish
this. However, since I do not want to allow additions but just want the
end-user to select and then edit the records and fill in one additional
field, I am not sure how to accomplish this task.

I am currently using the following code
DoCmd.OpenForm "Form5a", acNormal, "", "", , acNormal
Domd.GoToControl "[List2]"
DoCmd.GoToRecord , "", acNewRec

As I said this works great if I allow additions, which I do not want to do.

I would appreciate suggestions on how to accomplish this.

Thanks
 
One approach is to use a form/subform approach.

Put the listbox on the parent form.

Create a form for the records related to the listbox - set Allow
Additions to No. Use the listbox in the parent form for the criteria
of the records in the subform. Now use the form for the subform - use
the wizard.

In the After Update event of the listbox do a requery of the subform
control.

Me.sfrMySubform.Requery

That will bring up the records in the subform.

- Jim
 
Back
Top