G
Guest
i want to limit users ability to add records on my 'Screening Log' form to a
button i placed in the form header courtesy of the button 'wizard' to create
an 'add record' button. in the form's properties i have disabled the 'allow
additions' property so when i open the form the little '*' is stippled/greyed
out and unavailable to the user. i am using the following code
Private Sub AddRecord_Click()
On Error GoTo Err_AddRecord_Click
Me.AllowAdditions = True ' added by me
DoCmd.GoToRecord , , acNewRec
Me.AllowAdditions = False ' added by me
Exit_AddRecord_Click:
Exit Sub
Err_AddRecord_Click:
MsgBox Err.description
Resume Exit_AddRecord_Click
End Sub
which but for the pair of lines added by yours truly comes straight from the
cmdbtn wizard's mouth. so why doesn't it work: when i click the button the
record counter thing at the bottom of the form goes from 229 to 230 and then
back to 229 again (there are 229 records in the underlying table). what's up
with all this. i thought this would be really not all this difficult, so what
am i doing wrong?
thanks for any suggestions.
-ted
button i placed in the form header courtesy of the button 'wizard' to create
an 'add record' button. in the form's properties i have disabled the 'allow
additions' property so when i open the form the little '*' is stippled/greyed
out and unavailable to the user. i am using the following code
Private Sub AddRecord_Click()
On Error GoTo Err_AddRecord_Click
Me.AllowAdditions = True ' added by me
DoCmd.GoToRecord , , acNewRec
Me.AllowAdditions = False ' added by me
Exit_AddRecord_Click:
Exit Sub
Err_AddRecord_Click:
MsgBox Err.description
Resume Exit_AddRecord_Click
End Sub
which but for the pair of lines added by yours truly comes straight from the
cmdbtn wizard's mouth. so why doesn't it work: when i click the button the
record counter thing at the bottom of the form goes from 229 to 230 and then
back to 229 again (there are 229 records in the underlying table). what's up
with all this. i thought this would be really not all this difficult, so what
am i doing wrong?
thanks for any suggestions.
-ted