Control Source Errors

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there

I have a form with a sub form in it. The sub form totals up one of the coloums shown in the sub form and then passes this to a text box in the main form using the control source. How ever i would like this text box to then insert the figure in it into the database but cant work out how to let the text box do this. Hope someone can help me out

Regard

James
 
First, it is normally NOT necessary NOR recommended to store calculated
data, just calculate it when you need it. That said, place a textbox on the
form and bind it to the field in the table. Set its Visible property to No.
In the form's BeforeUpdate event, copy the value from the calculated textbox
to this new textbox.

Since the value that is changing is actually controlled by changes in the
subform, this may require a little modification. You may need to copy the
value in the subform's AfterUpdate event in order to make the main form
"dirty" or, perhaps, just set the main form's Dirty property to True.
Without the main form being dirty, it won't run its BeforeUpdate event.

--
Wayne Morgan
Microsoft Access MVP


James Proctor said:
Hi there,

I have a form with a sub form in it. The sub form totals up one of the
coloums shown in the sub form and then passes this to a text box in the main
form using the control source. How ever i would like this text box to then
insert the figure in it into the database but cant work out how to let the
text box do this. Hope someone can help me out.
 
Back
Top