How to Save Calculated Data?

General discussion on MS Access and its databases.

How to Save Calculated Data?

Postby Elwood M. Walker » Tue May 06, 2014 9:46 am

Hi everyone! I'm new to the forum but have been trying to figure out something similar to this question in http://www.accessforums.net/access/c...79/index2.html for several days. I've read through this post and the attached tip but can't figure out the code I need to make a calculated field show up on my table. My database is for technicians at work to log their hourly health checks. I have a field on form "Health Check" called "HC_ID" that I automatically bring over to the next form called "Channel_Scan_Form" with the control source property. I would like the data from this field to copy to the accompanying table called "ChannelScan_Table" from this "Channel_Scan_Form". I have tried to place the code in several different events on the property sheet but haven't had any luck bringing the data over to the table. I'm just starting to play with databases, plan on being here for a while and hopefully contributing in the future. Thanks for any help!
Elwood M. Walker
 
Posts: 33
Joined: Mon Mar 24, 2014 6:09 am

Re: How to Save Calculated Data?

Postby Tansenn » Mon May 12, 2014 6:22 am

Hi,
What do you mean by 'next form'? What is HC_ID field? Why are you duplicating the data? Is Channel_Scan_Form bound to ChannelScan_Table?

If you are trying to copy value from form to a table not associated with the form, that is not what the referenced thread discussed.
Thanks,
Tansenn
 
Posts: 28
Joined: Tue Mar 25, 2014 6:27 am

Re: How to Save Calculated Data?

Postby Elwood M. Walker » Mon May 12, 2014 6:25 am

I have a total of 7 tables and 7 forms to go along with them. So the technician would start at the "Health Check" Form where they enter the office, date, and time of the check. This form also has a auto populated field called HC_ID that I want to follow the user to each of the accompanying forms (Health_Check_Form,Channel_Scan_Form, GUI_Based_Checks_Form, Equipment_Room_Checks_Form, VOD_Form, OTT_Form, and STB_Form). The technician works their way through these forms until their checks are done. The point of trying to copy the "HC_ID" field throughout the forms and tables is to keep track of data for a particular set of health checks (say a health check on 4/25/14 2100hrs). The form and associated table both have the "HC_ID" data being stored on them. "Is Channel_Scan_Form bound to ChannelScan_Table?" Yes I do believe it is. Thanks again!
Elwood M. Walker
 
Posts: 33
Joined: Mon Mar 24, 2014 6:09 am

Re: How to Save Calculated Data?

Postby Tansenn » Mon May 12, 2014 6:27 am

Please use form/subform arrangement and no code will be needed. The Master/Child Links properties of subform container control will synchronize related records and automatically save the HC_ID value as foreign key in the subforms. If the subforms are large, can use a tab control to organize them by placing each subform on a page of the tab control.
thanks,
Tansenn
 
Posts: 28
Joined: Tue Mar 25, 2014 6:27 am

Re: How to Save Calculated Data?

Postby Elwood M. Walker » Mon May 12, 2014 6:31 am

That does sound like a good option but I've already spent a large amount of time designing the forms I have now. I did just try to use the wizard to build the form/subform but it gave me an error when it tried to build the form saying something like there are too many fields please reduce the number of fields and try again. Is there no easier way with code on my existing forms? Working on your suggestion now trying to incorporate my existing forms. Thanks for the help I'll post back in a bit!
Elwood M. Walker
 
Posts: 33
Joined: Mon Mar 24, 2014 6:09 am

Re: How to Save Calculated Data?

Postby Tansenn » Mon May 12, 2014 6:32 am

I never use the design wizard.

Drag the Subform/Subreport container control from the design tab onto main form in design view. Set the SourceObject property of the container to one of your existing forms. Set the Master/Child Links properties. Good idea to give the container a meaningful name, like ctrChannelScan. Then get rid of the code.
Tansenn
 
Posts: 28
Joined: Tue Mar 25, 2014 6:27 am

Re: How to Save Calculated Data?

Postby Elwood M. Walker » Mon May 12, 2014 6:33 am

Gotcha just finishing up building it now. Next step is to put together some useful queries and reports.
Thank you very much for your help!
Elwood M. Walker
 
Posts: 33
Joined: Mon Mar 24, 2014 6:09 am


Return to MS Access- Help Forum

Who is online

Users browsing this forum: No registered users and 0 guests

cron