PDA

View Full Version : Form Display and saving the values to the tables..



sindhuja
07-14-2008, 05:21 PM
Hi All,

Here is my requirement....

Depending upon the value from combobox from the main form, i need to display different subforms.

For ex, values in combo box will be one, two, three, four and five.
If i select "one", it should display form1, then form 2, then form 3.
if i change the value in combobox to "two" then it should display form4, form5 and form6 and i need to save all the values.

should save the values of each form seperately as per the combobox value...
:help
I am not sure wat is meant by bound forms and unbound forms...

-Sindhuja

OBP
07-15-2008, 01:41 AM
Providing that the forms are "Bound" which means their "data source" (where they get and put the data) is either a Table or a Query based one or more tables then you do not have "Save" anything as Access does it automatically.
Whereas an Unbound form requires Visual Basic or Visual basic and SQL to get the data from the table and also save it back to the table.
I have posted a "Search Form" that does something very similar to what you want to do, except it only shows one form at a time, where you can find the VBA code that you need.
Your code will need to go in to the Combo's After Update Event Procedure.
Here is the Thread

http://forums.techguy.org/business-applications/715768-access-help-see-attached-db.html

it also shows someone learnign to develop an Access database with baisc design considerations leading to more complex designs later.

sindhuja
07-20-2008, 05:44 AM
hi,

I am newbie to access. I went thorugh the link you suggested for..but its very much at high level... am not able to understand...

Hope you can help me out in my requirement.

-Sindhuja

OBP
07-20-2008, 07:06 AM
Sindhuja, I can see from your Forms that in Access terms you are trying to Run before you have learnt to Walk. :)
Can I ask why you have chosen to try and do it this way, as at the moment I can't see the point of having 1 table with 5 Fields and then a Form for each Field, rather than one form for the whole table? :dunno
Is this some kind of exercise/project that you have been given?
I have modified your 5 Forms so that at least they save the data to the relevant Field in the Table tblsam.

sindhuja
07-20-2008, 07:18 AM
Yes OBP, I am assigned a project....
Am totally confused...

Let me brief you again my requirement.

frmsam is the startup form. Depending upon the value of Combo0, we need to display the frm (something like a subform). IF 1 is selected then frm1 to be displayed in the frmsam (as subform).

i have to create different tables for different forms(tblfrm1,tblfrm2...)
If frm1 is selected as subform then i have to save values in frm1 also from frmsam in to the table tblsam.

Any help in proceeding further will be highly appreciated !

-Sindhuja

OBP
07-20-2008, 08:26 AM
This will give you a start, I hav eput 4 of the 5 forms on the Sam form and shown how to make them "Visible" when the combo box makes a selection.
Look at the Combo0's Properties in the "Event" tab, click on the "After Update" Event Procedure and then click on the 3 small dots on the right hand side to see the VBA code.

sindhuja
07-22-2008, 04:23 PM
But how to save the values in the subform and also values in the main form to a single table provided submit button in the main form.

Also is there a way to cature the submission type ie the time the save or submit button is clicked.

-Sindhuja

OBP
07-23-2008, 03:13 AM
The data is automatically saved to the tables.
You can add fields to your tables that are Date/Time type and have the field on the Form set to Default = Now()