Can't get Me.AllowAdditions to work with command button

  • Thread starter Thread starter John S. Ford, MD
  • Start date Start date
J

John S. Ford, MD

I have a form which has its AllowAddtions property set to False. I have a
command button with the following code:

Private Sub cmdNewAdmit_Click()
Me.AllowEdits = True
End Sub

I would have expected the new record navigator button to become enabled but
this doesn't happen and the form is still read only.

What am I doing wrong?

John
 
you're setting the AllowEdits property, instead of the AllowAdditions
property, John. which property do you mean to set?

hth
 
I'm sorry Tina, I posted incorrectly. My code is this:

Private Sub cmdNewAdmit_Click()
Me.AllowAdditions = True
End Sub

John
 
hmm, well, i'd expect it to work the same as you do. and, in my quick test
in an A2000 db running in A2003, it did work exactly as we expected. what
version of Access are you using? and what's the RecordsetType property
setting in the form?

hth
 
File this under "I'll never figure this out." For reasons that completely
elude me, this code has suddenly started working as expected.

Thanks for the help. I still don't understand what I did to make it
suddenly start working.

John
 
Hi John

PMFJI. For future reference, you could have tested the form standalone but
with OpenArgs in place so you don't have to comment out your OpenArgs
processing code. Simply open the form via a DoCmd.OpenForm call in the VBE's
Immediate window, supplying the OpenArgs argument.

Hope that comes in handy sometime.
 
Stuart, did you post to the wrong thread by mistake? We weren't discussing
opening a form here, with or without OpenArgs. we were talking about setting
a form property by running code on a command button's Click event.

hth
 
tina said:
Stuart, did you post to the wrong thread by mistake? We weren't discussing
opening a form here, with or without OpenArgs. we were talking about
setting
a form property by running code on a command button's Click event.

Yes, wrong thread. Thanks tina.

Please ignore this everyone.
 
Back
Top