Aug 4 2008, 03:50 PM
Is there anyway to set a continuous form's allow additions property to No, yet insert a new record through vba?
I get a runtime error 2105, "you can't go to the specified record", with my current code.
Aug 4 2008, 03:57 PM
You can always generate the record in code, append it via SQL, then requery the form.
Or, if you want them to be able to add a row manually. Put a button that will enable the New record.
Me.AllowAdditions = True
DoCmd.GoToRecord , , acNewRec
THen in the AfterUpdate event of the form, turn off the AllowAdditions property:
Me.AllowAdditions = False
Well you won't be able to go to an empty row to add values
if AllowAdditions is set to no so I you'll have to explain where
you want to enter values for the new record.
Popping up an entry form is a reasonable thing to do.
Aug 4 2008, 04:40 PM
Either of these 3 will work.
1. Compute in code and insert via SQL and requery the form (my example1)
2. Enable allowAdditions, edit, turn it off (my example2) (for manual input)
3. Open a data entry form (Ace's example). (for manual input)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here