How do I populate a database using forms?

J

Jim Robinson

I can find thousands of suggestions, tips, and examples of how to read data
from a database but can find nothing that tells how to use a form to add
records to a database.
I find that forms can be used to display and/or enter data in the "about
forms" part of help, but nothing tells me how to set up a form for data entry.
I want to enter all the various items that make up a record in a form and
then click on a "SAVE" or "SUBMIT" button to add that record to the database.
How do I do this?
 
N

Nikos Yannacopoulos

Jim,

Using the autoform function on a selected table (Insert > Autoform) is a
good start on how to make a form. By default, a form will allow you to
enter data. No "save" button requirent, the moment you move to another
(new or existing) record or close the form, the record will be saved.

HTH,
Nikos
 
R

Rick B

Any form based on a single table or a query with a single table is probably
able to do this. The same form that you built to edit records will most
likely allow you to add records. Just click the new record button in the
record selector box. It looks like >* There is no need to click an
"add" button. Simply press page down after you have entered the data and it
will take you to another new record where you can start adding again.

Rick B
 
B

Bob Wardlow

Hello Jim;

Forms are by default created to accept new data entry. Click the navigation
button on the bottom of the form with a star on it. That will create a new
record. Fill in the fields. There is no reason to have a submit button.
Access automatically saves new record information after you leave the field.
If you would like a form that it dedicated to only adding new records you can
do this by viewing the form properties and changing the Data Entry property
from No to Yes. Then you will not be able to browse records you will only be
able to add new ones.

Hope this helps.

Bob
 
J

JEFF

But What if those boxes are disabled (ie greyed out) on your form, thus not
allowing Submittal

Jeff
 
R

Rick B

Then I would probably look at the design of the form and see why they are
disabled. Did you create some code to disable them?

Rick B
 
J

Jeff

Thanks Rick, I wouldn't even know how to do that. I have comboboxes from
multiple sources in which I want to take the selections of each and enter
into my main table. I finally got the combobox functionality working now I
am trying to submit to the database. ... No luck

I did create code to update the combobox, using the OnNotInList property,
but that is it

jeff
 
R

Rick B

It sounds like you are making this all harder than it has to be. When you
create a form, you should tell it the source (the query or table) right in
the start. Then, you can drag fields from the field list to the form.
Sounds like you started by building an unbound form with unbound controls,
then tried to tie all those fields to a table. VERY VERY long way to get
there.


To fix your combo box, you need to open the properties and change the
Control Source in the Data tab. That is the field in your table that gets
updated with the contents of the control. If you drag the fields from the
field picker list, this is already done for you. Plus, any defaults or
edits that you defined in your table are going to be there.

Rick B
 
J

Jeff

Thanks Rick,

I did everything that you mentioned, at least I thought I did. The only
thing different that I see in your comments is the discussion of the
combobox. Currently my control source is empty. and when I tried to enter
something there, the expression builder appeared. i tried to place
![Field] there from expression builder, the form field became "bound"
and I was unable to enter data, or use the combobox functionality at all.
Now that I have the VBA code right. I am going to start near the beginning,
since I dont have that many fields, and see if I can get it to work.

Jeff
 
J

Jeff

OK Rick,

I used the Forms Wizard to build another form and it did in fact work.
Looking at the control source, it appears I was typing in the wrong name of
the control I wanted initally, and I assumed it just wasnt working so I tried
something else. Many thanks for the assistance

Jeff
 
F

FBrnstrmr

I know this is an old thread but it takes me to where I am now but has no
answer. I have built a "busy" form which I don't wish to recreate. Can anyone
tell me why or what needs to be changed in the control source to make the
combobox selection be placed in the table as desired. Thanks very much,
-F
 
J

John W. Vinson

I know this is an old thread but it takes me to where I am now but has no
answer. I have built a "busy" form which I don't wish to recreate. Can anyone
tell me why or what needs to be changed in the control source to make the
combobox selection be placed in the table as desired. Thanks very much,

The table needs to be the Recordsource of the form (or the recordsource needs
to be an updateable query including the table); the Control Source property of
the combo box needs to be the name of the field.

Other than that, you'ld have been much better off starting a new thread
describing YOUR table, form, and combo box - because you'll just be asked to
do so anyway!
 
F

FBrnstrmr

where do I assign the Recordsource to the form, if I open up the form
properties it is just an information screen. No options to change anything
but the description.
 
J

John W. Vinson

where do I assign the Recordsource to the form, if I open up the form
properties it is just an information screen. No options to change anything
but the description.

Sorry, this isn't making sense to me.

What version of Access are you using? Is this a .mdb, .mde, .accdb or .accde
file? How are you opening the form in design view?
 
Top