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

how do i create

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

ResolvedVersion 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:

Switchboard Startup

An option when you open your Access database that contains all of you tables, forms and queries is only the switchboard is displayed.

To achieve this, select Tools click on Startup. On the right hand side of the Startup screen you are able to select which form you want to open when you open you Access Database. Once you have selected this, there is a check box just below that says "Display Database Window", you need to uncheck this option. Then click ok.

Then when you close you Access database and re open it, the database should open with just the switchboard being shown


View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.