how do i create
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

replyReply Sat 18 Dec 2010, 18:17Delegate Astley said...

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

For upcoming training course dates see: Pricing & availability

replyReply Thu 23 Dec 2010, 12:25Trainer Nafeesa said...

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

replyReply Tue 4 Jan 2011, 16:14Trainer Mark said...

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

 

Please browse our web site to find out more about
microsoft database training and other Microsoft training courses.

Access tip:

Modal forms

If you have created a form / switchboard and dont want people to get away from using the switchboard, you can change the form properites for Modal to On.

View all Access hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard