473,386 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Saving from one form to multiple tables

Hello

I am trying to save information from one form to two tables. I have
a table for Student info and Transcript line. I have a form that list
all the classes (using text boxes) a student is supposed to take to
graduate. This form also has a combo box for assigning grades for each
class. I am trying to save information from the form to the student
info table and to save each class on the form as separate records in
the transcript line Table. Could anyone please point me in the right
direction or give me any ideas on how to go about this. Thanks.
Nov 13 '05 #1
2 4003
You can create code to dimention 2 recordsets (one for each table). First I
would create 2 querys, 1 based on each table. I have found that
manipulating query's via recordsets seems to work better than manipulating
tables directly.

Look up Recordset and RecordsetClone in the help. This will definitly solve
your problem.

Just to start you off...look for something like this:

dim dbs as database
dim rst1 as recordset ' query 1
dim rst2 as recordset ' query 2

set dbs = currentdb()
set rst1 = dbs.openrecordset("query1", dbopendynaset)
set rst2 = dbs.openrecordset("query2", dbopendynaset)

at this point you can use a With statement and Wend if you want, but if its
only 1 record being written you wont need to.
use .addnew to add a new record to the query/table or use .edit to edit an
existing record.

rst1!TargetFieldname = me!Sourcefieldname
rst1.addnew
etc.
etc.
do this for as many fields as necessary.
rst1.update

rst2!TargetFieldname = me!Sourcefieldname
rst2.addnew
etc.
etc.
do this for as many fields as necessary.
rst2.update

dbs.close
set dbs = nothing
set rst1 = nothing
set rst2 = nothing
HTH
Paul

"Tolu" <ro**************@yahoo.com> wrote in message
news:91**************************@posting.google.c om...
Hello

I am trying to save information from one form to two tables. I have
a table for Student info and Transcript line. I have a form that list
all the classes (using text boxes) a student is supposed to take to
graduate. This form also has a combo box for assigning grades for each
class. I am trying to save information from the form to the student
info table and to save each class on the form as separate records in
the transcript line Table. Could anyone please point me in the right
direction or give me any ideas on how to go about this. Thanks.

Nov 13 '05 #2
ro**************@yahoo.com (Tolu) wrote in message news:<91**************************@posting.google. com>...
Hello

I am trying to save information from one form to two tables. I have
a table for Student info and Transcript line. I have a form that list
all the classes (using text boxes) a student is supposed to take to
graduate. This form also has a combo box for assigning grades for each
class. I am trying to save information from the form to the student
info table and to save each class on the form as separate records in
the transcript line Table. Could anyone please point me in the right
direction or give me any ideas on how to go about this. Thanks.


Looks like a query to return a set of classes the student is supposed
to take (Cartesian product with filters). Put this stuff into a
multi-select listbox, put a button on your form to run an append query
to some ClassRoster table, then show the results for the current
student at the bottom of the form in a grid and have a combobox for
entering grades or something like that. And you're done.

There's code at Accessweb to do the hard stuff here. (playing with
multi-select listboxes, etc).
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: L Major | last post by:
Hi Unfortunately, I am limited to using tables for part of my current project. I have a form that spans across a number of TR and TD in the shape of checkboxes. Doctype is XHTML 1.0...
2
by: IanCraft | last post by:
I am new to Access 2002 and have a questions regarding using a form for data entry. I have 15 items I need to keep track of that are listed individually on a form as follows: Item#1Name ...
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
13
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've...
2
by: manning_news | last post by:
Has anyone had a problem with Access 2003 not saving their coding? I've been using 2003 for a couple of months now and just this week noticed that some coding I'd done for a database was not there...
4
by: curtis m. west | last post by:
hello ng i'm new to vb.net and start working with datasets. now i have the following problem: how do i get a table (or multiple tables) from a dataset saved to an mdb-file? searching thru the...
5
by: mimo | last post by:
Hello, I have seen samples on how to pull data from one table and save back to it using the Form View control. How do I pull from multiple tables and save back to multiple tables on one...
13
by: ricky.agrawal | last post by:
I'm really not sure how to go about this in Access. What I've created is a table for each location. Those tables are identical in format but different in information. The tables are named after...
1
by: Magnus | last post by:
I'm testing walkthrough saving data to a Database (Multiple Tables). http://msdn2.microsoft.com/en-us/library/4esb49b4(VS.80).aspx In the famous Customer/Order example, I'm getting referential...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.