Allow additions

  • Thread starter Thread starter Junior
  • Start date Start date
J

Junior

In a form i have entered several records and then set the 'allow additions
to no in order to exclude others from adding records - i only want to allow
them to edit the existing records in the underlying table.
This works when i open the form form the database window -but when the form
is opened from an event using the below code - the form allows eadding
additional records- how can i limit the records when opening from an
event???

DoCmd.OpenForm "flkpNurSpec", acNormal, "", "", acEdit, acNormal
 
Junior,

Here are two methods. In the OnOpen event of the form put
in...

Me.AllowAdditions = False

or add the following line right below your existing OpenForm
line.

Forms!flkpNurSpec.AllowAdditions = False

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
According to VBA Help on the OpenForm method, if you leave the DataMode
(acEdit) argument blank, the form will open in accordance with its property
settings. I haven't had a chance to test this, but give it a try.
 
You don't need that line of code! Just open the form in design view and open
properties. Go to the Data tab and set Allow Additions to No but leave Allow
Edit set to Yes.
 
PC- those are my setting now- and it doesn't work when opened with VBA
Gary miller was right on with the solution
Cheryl - i didn't try yours since Gary had the solution
thanks all for your help
 
Back
Top