adding a record to sql tables from a form

R

RON

hello,
can anyone help me as i am really strugling.

I have made a form in access, with such things as lastname, firstname,
address, etc and people can enter this into text boxes on a form.

then i want an isert button that will take anything that is in those
textboses and put them into a sql table.

i know how to open up a connection to the sql server, but thats where it
ends really

so for example say this form has a field called Lastname and it is in
txtLastName When Insert is pressed I want the text of txtLastName to go
into my SQL Table, named Users for example and I want it to go into the
LastName field

thatnks for any help anyone can provide
 
T

TC

You don't need any code, at all.

Just set the RecordSource property of the form, to the name of the
table. Then set the ControlSource property of each textbox, to the name
of the corresponding field in that table.

Voila! You now have a so-called "bound form". You'll be able to query,
add, edit & delete records to the table, using that form, without
having any code.

Maybe get an introductory Access book? Access can do tons of things,
but it's hard to learn without some help!

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
R

RON

i want to update an SQL Server table with the data that is in my access
forms text boxes.. i dont want to just put this data into a table in
access.

is this still possible or did i miss understand?
 
T

TC

Then just create a "linked table". A linked table looks and works just
like a local table, but it actally points to the real table in a
different Access database file, or, a table in a different product such
as SQL*Server.

For various reasons I can not give you a step by step on hw to creae
the linked table. Try googling "linked tables", you'll doubtless find
lots of information. Or someone else will jump in & help. The key thing
is, YES you can easily do what you want, and NO, you do not need any
actual code!

HTH,
TC (MVP Access)
http://tc2.atspace.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top