By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,456 Members | 1,952 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,456 IT Pros & Developers. It's quick & easy.

expression generator in the form- data are not saved in corresponding table

P: 2
Hi, I am using the expression generator in a text box in my Form. I added the text box in the Form from a field that I had previosuly created in my table. Everything works on the form (I get the calculation that I wanted, average depths), but when I go to my table the fields are blank, the data are not there but it is shown on the Form. Can anybody tell me how to make access save the data in the table? Thanks
Apr 21 '10 #1
Share this Question
Share on Google+
2 Replies


TheSmileyCoder
Expert Mod 100+
P: 2,321
The expression generator makes a calculation for you. Once you start using something like an expression generator, the field is no longer bound to a specific field in your table.

What you can do if you need to store this kind of information, is to make a second field in your form, bind it directly to teh field in your table, and then set its Visible=False. Now in the beforeupdate event of your form, you can then make the code store the generate value in the hidden textbox.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_BeforeUpdate(Cancel as integer)
  2.   Me.BoundField=Me.CalculatedField
  3. end Sub
This is the solution to your problem as described, but I would like to make sure we are solving the right problem. Therefore I ask, why do you need to store the calculated value, and why not just calculate it when needed?
Apr 21 '10 #2

P: 2
@TheSmileyOne
Hi, thanks for the answer. That didn't work. I'm new using access so I don't know much about it. I wanted to have the information generated by the expression generator on my tables for posterior analysis but I guess another option is to generate that information in queries and use those. And using those unbound fields on the forms only for visual purposes
Apr 21 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.