Saving form data

singingshiver

Registered User.
Local time
Today, 03:01
Joined
Jul 23, 2002
Messages
51
I have created a form but the data entered wont save. There is no table created for it is this why?
 
S,

Yes, almost certainly. Forms are merely "windows" to data in tables.

Regards,
Tim
 
I have deleted the form, created a table and created a new form based on the table but the data still wont save. Any ideas?
 
check the control source of your text boxes in the form and make sure they are bound to the feild in the table!
 
This is what i have. A table called SFI that has a form created based upon it. the form is Called SFI and is used to input information. There is a button on the form that when pressed copies certain fields into another form called Learning. And it is the learning form that will not save.
 
so you have 1 table with 2 forms(that have different info on them??)

what are you trying to do?

if you have a form that is bound to a table then the data should save to the table. if you have another form with different info on it and your table doesnt have those feilds where did you want the data saved to?

you will have to let people know what you are doing and why you need the data saved..im not verry good myself but others will help if you give them the right idea. Ill try but i need a clearer pic.
 
Table SFI links to form SFI. Form SFI is used to input data and is then saved. Table SFI is updated automatically due to the table and form being linked.
there is a command button on the SFI form that copies the requested data to a new form which is form SFI Learning. Form SFI learning was created based upon table sfi learning which is contains the headings I need but with no data in it.
Am I right in thinking that I need the data to be sent to the table sfi learning when the command button on form sfi is pressed, and this will make the data on form sfi learning visible? If so, how?
 
Four ways to skin this cat. (Meeeoooow!)

OK, here is your problem. I think it might be conceptual. My answer is not intended to be insulting if it turns out that I talk beneath you. However, I must gauge my answer based on what I see in your posts.

Lynsey suggested that a form is a window into a table. Actually, this is almost correct. A BOUND form is a window into a particular record source, which could either be a query or a table. Since a query must in turn be bound to one or more tables, a BOUND form is a direct or indirect window into one or more tables. An unbound form is anything you want it to be.

A form is NOT automatically a window into TWO recordsources, but that is what you seem to want. (The two recordsources are tables SFI and SFI Learning, as you described them.) There is an old saying about "one person cannot serve two masters." Well, one form cannot serve two distinct record sources. And that is where you are getting into trouble.

I can think of a few ways to update your SFI Learning table. However, each one requires some design issues to be resolved.

Method 1: Make a join between the two tables that gets all records from SFI and any matching records from SFI Learning. This is a parent/child setup with SFI Learning as the child. It is OK to establish relational integrity for the relationship, in which an entry in SFI Learning MUST correspond to an entry in SFI. Then make the SFI Learning form a sub-form of the parent SFI form. Link the two on whatever is the primary key of the SFI table, assuming you have a primary key. You should then be able to populate the sub-form (at least partially) from the context of the parent, because the controls of the sub-form are visible to the parent form.

Method 2: You can independently activate the form associated with SFI Learning and directly store data in its controls. But you would have to create an appropriate DoCmd action to store THAT form's record. Storing the SFI form shouldn't be difficult because the Access wizards will build you that command button pretty much automatically. Storing another form's record, assuming the form exists and is populated, is just a similar DoCmd action. Other code you might have added in the SFI Form's STORE button is incidental. Look up the DoCmd .Save (or is it .SaveRecord? I always have to look that one up) action as a way to force the other form to store its date. The DoCmd .SaveRecord action normally defaults as to which form's data gets saved, but there is an option that names the form. So a command button on form A can certainly save data on form B.

Method 3: Open a direct recordset to SFI Learning, bypassing the form. Add a new record, populate the fields, and update the recordset. Then close it. I posted some rather detailed instructions recently about how to manipulate recordsets. If you are not familiar with this process and wish to try it, do a search of the forum for recordset info.

Method 4: (This is "iffy.") Make a join between the SFI and SFI learning tables as a peer-to-peer relationship. Relational integrity CANNOT be in force for this join. Don't bother with a separate form for SFI Learning. Instead, when you create the new record for the SFI table, cause some of the other fields that come from the SFI Learning table to also be populated. When you save the form, you save to both records at the same time, because (as long as the relationship is unequivocal) a save through a joined query updates ALL tables that participate in the query. NOTE: This query, to be updatable, cannot contain ANY aggregate functions.
 
Doc_man is a shining light

Thank you so much for your help. i feel most comfortable using method 1. I am designing the database for work and keep being asked to add things to it and i am gettin so deep into it that I am missing the basics.
Thank you so much for your help.
 
Stuck again

I am having difficulty with the following:

Make a join between the two tables that gets all records from SFI and any matching records from SFI Learning. This is a parent/child setup with SFI Learning as the child. It is OK to establish relational integrity for the relationship, in which an entry in SFI Learning MUST correspond to an entry in SFI.

How do I make this join? and setup the relational integrity.
 
Go to 'Tools' on the menu bar and choose 'Relationships'. Then choose 'Relationships on the menu bar and choose 'show table'. This will give you a window with the names of your tables in it. Choose the tables you wnat and click 'Add'. These will display inthe main relationships window.
Then click on the field name you want and link it to the corresponding field name in the other table by dragging it across (presuming you have Id fields to link?). You need to make sure that you drag from the correct table otherwise the relationship won't work.
To enforce referential integrity, right click on the line (relationship) between the tables, choose 'edit relationship' and 'enforce referential integrity'.
HTH
 
Advice plz

I am stuck on this:

Then make the SFI Learning form a sub-form of the parent SFI form. Link the two on whatever is the primary key of the SFI table, assuming you have a primary key. You should then be able to populate the sub-form (at least partially) from the context of the parent, because the controls of the sub-form are visible to the parent form.

Any ideas?
:)
 
If you're talking about the data in the form, then in design view, you will see a small grey square in the top left of the screen (it's at the junction of the 2 bars with numbers). Click on this and look at properties. By clicking on this square you will then be able to go to record source in properties and then just type in the name of the table you want.
I presume this is what you mean? If not, explain in more detail.
 

Users who are viewing this thread

Back
Top Bottom