473,748 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4080
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.openrecords et("query1", dbopendynaset)
set rst2 = dbs.openrecords et("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!TargetFiel dname = me!Sourcefieldn ame
rst1.addnew
etc.
etc.
do this for as many fields as necessary.
rst1.update

rst2!TargetFiel dname = me!Sourcefieldn ame
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.goo gle.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.

Nov 13 '05 #2
ro************* *@yahoo.com (Tolu) wrote in message news:<91******* *************** ****@posting.go ogle.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
7158
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 Transitional, Encoding is utf-8 Is there anything wrong? Should I try something else? What in that case?
2
6613
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 AmountOut AmountIn Item#2Name AmountOut AmountIn etc. Each day, the user opens this form and records the amount they have taken or put in for each of the 15 items. This form, when submitted,
2
5470
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 like to eventually be able to filter down through the tables untill i can reach one unique record. I am creating a datbase to keep track of registered accounts for a stae program. Each account is registered into the program through a two...
13
7409
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 created forms for both those tables, and inserted the child table form into the master table form as a subform. It works just as it is supposed to, in that I can create a new master record, and then add detail records.
2
1827
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 anymore. I reentered it and didn't have any problems for a couple of days. Today I entered some coding, saved it, opened another database, and when I opened my original database again, the coding I had entered was missing. Access 2000 always...
4
2265
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 web i found the ".fill-method" for filling the dataset with the data from an mdb-file - but no clue how to do it "the other way round".
5
3066
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 screen? Is there a sample of this somewhere? For example I want to create a Name and an Address from one screen. It has to create a Name Record, a Name Address Record, and a NameAddressJoin Record.
13
6784
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 key points such as the store number and the store ID. The fields of those tables are generic fields such as sales per day, bank deposit and what not. The first field for each store table is the date and I've set that as the primary key as one...
1
2599
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 integrity problems "The INSERT statement conflicted with the FOREIGN KEY constraint..." if the identity/primary key column is "out of sync" with the identity value in the database. I can easily acheive this f.ex. by pressing add new record,...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9386
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.