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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get my buttons to add and delete in my form?

Status
Not open for further replies.

dawnh44

MIS
Jul 16, 2002
16
0
0
US
I've created buttons to add and delete items from my form. They do not work. Can someone please tell me how to make this work? Thank you.

Dawn
 
Hi Dawn,

Is your form's data recordsource defined as the table (or query)? If it's a query, is it an updatable query? If not, we need to modify the underlying data of the form. Maybe look at it from a different angle...

Next viewpoint is, how is your form set with the following properties?
Allow Filters
Allow Edits
Allow Deltions
Allow Additions
Data Entry

Believe it or not, those can be very powerful settings, but they're a pain the u-no-what when it comes to debugging forms.

I look forward to helping you, Roy McCafferty
aka BanditWk

Las Vegas, NV
roy@cccamerica.org
RLMBandit@aol.com (private)

"I do this because I know I can - no need to send gifts - just send me a smile to show me that I've helped." ~ seen on a cardboard sign held by Roy McCafferty on a corner in Las Vegas
 
Hello,

My form's data recordsorce is defined as the table.

The following are my settings:
Allow Filter->Yes
Allow Edits->Yes
Allow Deletions->Yes
Allow Additions->Yes
Data Entry->No

I had to keep Data Entry at No. Once I changed Data Entry to Yes, my form didn't show anything from my table.

Thank you. Thank you for any help you offer. You have no idea how much I need assistance. LOL :)
 
For the Add Button:
OnClick do this EventProcedure:
DoCmd.GoToRecord , , acNewRec

For the Delete Button:
OnClick do this EventProcedure:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

This is the exact same coding as if I had used the Button Wizard.

HTH! Roy McCafferty
aka BanditWk

Las Vegas, NV
roy@cccamerica.org
RLMBandit@aol.com (private)

"I do this because I know I can - no need to send gifts - just send me a smile to show me that I've helped." ~ seen on a cardboard sign held by Roy McCafferty on a corner in Las Vegas
 
Hello,

I just checked the EventProcedure's for both buttons, and the codes were already there. I think this isn't working, because I'm trying to add/delete through a subform/subreport that I added to my form. I'm not sure how to get these button to work with my subform/subreport. Any assistance would be wonderful.

Thank you for your suggestion.

Dawn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top