By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,479 Members | 2,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,479 IT Pros & Developers. It's quick & easy.

Transfer data from a form to table

P: n/a
I am new to access can someone tell me how do we send the data entered
from an inquiry form to a table.

say i have a form which has fields

client name
client address
client phone
client email

and i have a submit button.

how do i send this information entered by the user to the client table.

if possible a sample code would be helpful.

Thanks a lot.

Apr 19 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
If the form is bound to the table, then Access does it for you. (if you
run the form wizard and choose the table you want, it'll do this for
you).

Apr 19 '06 #2

P: n/a
Thanks for the response.
but i have my form designed already which has other info too...and also
i want this part of the info to be saved in the client table.

will this stmt do??

Private Sub Submit_Click()
Set db = CurrentDb()
db.execute("INSERT INTO TABLE CLIENT VALUES (" '" _
& Me.&ClientName & "', '" & Me.&ClientAdd & "','" & Me.&ClientPhone &
"','" & Me.&ClientEmail & "');")
End Sub

Apr 19 '06 #3

P: n/a
Do you mean you designed the form and then bound it to the table later?

You _can_ do it the way you suggest, but you're making things hard for
yourself. you don't get field-level validation on the form if you do
that... but there are sometimes reasons for doing things that way.

Why will binding the form to the table not work for you?

Apr 20 '06 #4

P: n/a
how do u bind the form to the table???

Apr 20 '06 #5

P: n/a
may be i can email u my mdb file and u cud have a look at it....wat
say??

Apr 20 '06 #6

P: n/a
wud u like to have a look at my forms and tables??? if yes i could
email them to u....

Apr 20 '06 #7

P: n/a
Br
kanthi wrote:
how do u bind the form to the table???


Set the form's Record Source property. Then set each control's Control
Source to the corresponding field name in the table.

Use the built-in form wizard and see what it does.
--
regards,

Br@dley
Apr 20 '06 #8

P: n/a
Hi!

First u design the table, make sure the id field is an autonumber, then
the other fields text fields, and saves it. Close it.

Then u go to the forms section and chooses to make a form with the help
of a wizard.

The wizard will give u all tables presents in a combobox and underneath
all available fields in that table. Choose the table first and then U
just pick all fields and chooses 'next' in the wizard.

Then the wizard will ask u what kind of layout u will choose for the
form. Choose Column.

Then the wizard willl ask u what kind of style u wants for the form.
Choose Default. Push next.

Now u must choose a name for the form. U can choose 'frmClients'
(Likewise u called your table: 'tblClients)'.

Then the wizard will ask u which fields from the table u want bound to
the form, u choose all

Choose 'Finish' in the wizard and voilá! you're done.

Because clientid in the table is an 'autonumber field', access will by
default use this field to to bind the table to the form. This means
that when u insert information in the textfields, access will
automatically update the autonumber field and when u move on to a new
record or even closes the form, access will save information u entered.

Then....go and have someone by u a good book for beginners on access
and start readind and training. You'll succeed!

Good luck

Me.Name

Apr 20 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.