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

  • Thread starter John S. Ford, MD
  • 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
 
T

tina

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

hth
 
J

John S. Ford, MD

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

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

John
 
T

tina

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
 
J

John S. Ford, MD

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
 
S

Stuart McCall

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.
 
T

tina

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
 
S

Stuart McCall

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top