addiing a record to a table from a form

seriouslystuck

Board Regular
Joined
Sep 24, 2009
Messages
97
Hi All

I need some help! This is my first attempt at a DataBase. I have created a Form in access 2003 that I want the user to complete then on clicking a command button it adds the data as a new line in the table. I have tried the wizard and created the add record button which opens the VB window but Im not sure what code to add..

Any advise would be great.

Thanks
 

Some videos you may like

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

seriouslystuck

Board Regular
Joined
Sep 24, 2009
Messages
97
Just to add to this each text box on the form is controlled by a different table as they are all drop down boxes. I have a main table where I want the new record added when the command button is clicked.
 

alansidman

Well-known Member
Joined
Feb 26, 2007
Messages
6,069
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
If your form is bound to your "main table," then you do not need a command button to update your table. Closing the form or advancing to a new or old record will automatically update your table.

If however, your form is not bound to your table, then you will need to take a different approach. Here is a video tutorial if that is the situation.

http://www.datapigtechnologies.com/flashfiles/addformrecordsnocode.html

Alan
 

Montez659

Well-known Member
Joined
May 4, 2005
Messages
918
Alan, that tutorial was extremely helpful. I was wondering if you could point me in two directions:
1.) I am having trouble with my listbox repainting when the new record is added. I am not quite sure of the syntax.

2.) I would like to be able to delete by double clicking on an item from the listbox. I am sure it involves some of the same things as this, but if there is a demo and you know, I would like to know.

Thanks for the help!
 

Watch MrExcel Video

Forum statistics

Threads
1,123,337
Messages
5,601,026
Members
414,422
Latest member
acegreen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top