Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AllowAdditions button only one record at a time

Status
Not open for further replies.

oxicottin

Programmer
Jun 20, 2008
353
US
Hello, I have a subform [frmMachineOutputSubform] and need a button to add only one record to the subform. I have the forms properties set to "Allow Additions = no". When I click the button it adds the new record but leaves the allow on. I tried to use allowadditions = no after go to new record but it did nothing. I just want to add a new record one at a time. How can I do this?


Code:
Private Sub cmdAddNewProduct_Click()
Me.AllowAdditions = True
    DoCmd.GoToRecord , , acNewRec
End Sub

Thanks,
SoggyCashew.....
 
How are ya oxicottin . . .

In the forms On Current event try the following:
Code:
Me.AllowEdits = Me.NewRecord
With the above only the new record line can be edited. Previous saved can not (and you don't need the button).

Your Thoughts!

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top