how do i create

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » How do I create 2 buttons using vba to add and delete records on

How do I create 2 buttons using vba to add and delete records on

resolvedResolved · Urgent Priority · Version 2007

Astley has attended:
Access Advanced course

How do I create 2 buttons using vba to add and delete records on

I have developed an access form in access 2007 with records of different customers. I would like to create 2 buttons using vba to delete a customer's record if they decide to leave the company, and a button to add a new customer to the existing customers records on the form. Do you have any ideas of code I can use to perform these operations? If you have any sample code that would be very helpful.


Thanks for your contributions



Astley

RE: How do I create 2 buttons using vba to add and delete record

Hi Astley,


Thank you for your question & apologies for the delay in getting back to you.

The Access VBA trainer will endeavour to get back to you as soon as possible.

Thank you for your patience.


Regards,


Nafeesa

Microsoft Office Specialist Trainer

RE: How do I create 2 buttons using vba to add and delete record

Hello Astley,


Thank you for your question regarding Access VBA buttons.

You do not have to write any code as Access has these built in. When in Design view of a form, view the Toolbox and ensure the small button at the top of this toolbar is selected, looks like a magic wand with stars!!!! This activates the Wizard. Then select from this toolbox toolbar the Command button object (hover over all the buttons on the toolbar if unsure, it will tell you what they are).
When you click to create the command button somewhere on your form a Wizard dialog box will appear with lots of preset vba/macro commands. You'll see the Delete Record and Add record ones in there.


I hope this resolves your question. If it has, please mark this question as resolved.

If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?

Have a great day.
Regards,

Mark
Microsoft Office Specialist Trainer

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Access tip:

Insert The Current Date

To insert the current date into a Table field or Form Text box use:

Ctrl+Semi-Colon(;)

View all Access hints and tips


Server loaded in 0.07 secs.