Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / July 2006

Tip: Looking for answers? Try searching our database.

Select data from one table and save resulting record to another ta

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tara Finlay - 04 Jul 2006 13:59 GMT
Hi,
I have some experience with SQL Server but not with Access and I find the
two to feel very different so I apologize for my ignorance.
I have a table called Pastry and I made a form with a bunch of drop down
lists that are populated by queries from that table. I want the user to go
through and make his or her selections, and then to save those selections as
a record in another table. Seems pretty simple but I can't make it work in
access. I have an Access bible and I have searched extensively online but I
cannot seem to find the answer to this question: How do I select options in a
form from one table and save them to another?
Thanks,
Tara
tina - 04 Jul 2006 15:18 GMT
is your form bound to that "other" table? and is each combo box control on
the form bound to a field in that "other" table?

hth

> Hi,
> I have some experience with SQL Server but not with Access and I find the
[quoted text clipped - 8 lines]
> Thanks,
> Tara
Tara Finlay - 05 Jul 2006 13:07 GMT
Hi Tina,
I assume they are unbound... how do I bind them?
Tara

> is your form bound to that "other" table? and is each combo box control on
> the form bound to a field in that "other" table?
[quoted text clipped - 16 lines]
> > Thanks,
> > Tara
tina - 06 Jul 2006 01:44 GMT
to bind a form to a table (or a query), open the form in design view and, in
the Properties box, click on the RecordSource property. enter the name of
the table or query you want to bind the form to, and now it's bound.

to bind controls on a form to fields in the form's RecordSource, open the
form in design view and click on a control. in the Properties box, click on
the ControlSource property. enter the name of the field, from the form's
RecordSource, that you want to bind the control to, and now it's bound.
repeat for each control that you want to bind to a field in the
RecordSource.

if you bind your form/controls to a table(or query)/fields, then you are
essentially entering data directly into the table, via the form interface,
with no need for an Append query to write the data to the table.

hth

> Hi Tina,
> I assume they are unbound... how do I bind them?
[quoted text clipped - 20 lines]
> > > Thanks,
> > > Tara
Ofer Cohen - 04 Jul 2006 18:57 GMT
Use an insert SQL

Docmd.RunSql "INSERT INTO TableName ( DateFieldName, StringFieldNAme,
NumberFieldName) VALUES (#" & DateParameter & "#,'" & StringParameter & "' ,
" & NumberParameter &")"

If you want to add a values from fields in the form, change the parameter to
Me.FieldName
Note the different between date (need #) string (need ') and number (need
nothing)

Signature

Good Luck
BS"D

> Hi,
> I have some experience with SQL Server but not with Access and I find the
[quoted text clipped - 8 lines]
> Thanks,
> Tara
Tara Finlay - 05 Jul 2006 13:06 GMT
Thank you- this is very helpful. Can you give me one more bit of direction? I
understand the SQL, but where does it go? I don't understand enough about the
Access UI to know where the SQL goes to make the save happen.
Thanks,
Tara

> Use an insert SQL
>
[quoted text clipped - 19 lines]
> > Thanks,
> > Tara
Ofer Cohen - 05 Jul 2006 15:45 GMT
You can use a button on the form, after all the selections are made and the
user click on the button you can run this code to save the record in the
table, use the OnClick event of the button to run the SQL

Signature

Good Luck
BS"D

> Thank you- this is very helpful. Can you give me one more bit of direction? I
> understand the SQL, but where does it go? I don't understand enough about the
[quoted text clipped - 25 lines]
> > > Thanks,
> > > Tara
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.