Multiple control sources for a text box

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

I have a database that acts like a timesheet for fellow
employees. they can choose what time they come into work
and leave work by combo boxes. From this, there is a text
box that calculates how many hours they have been at work -
i have used an IIf expression for the control source of
the text box. however, i was wondering if there is a way
to store the value the text box calculates in the table
where all the other info is being stored?? thanks.
 
Yes, but don't. You shouldn't need to store information you can calculate.

Now, how to do it. The simplest method is probably to add another, hidden (Visible=No)
textbox that is bound to the field. In the BeforeUpdate event of the form, set the value
of this textbox to the value of your calculated textbox.

There are other ways if this doesn't work for you. But, as mentioned to begin with, it is
not normal database structure to store calculable data.
 
thanks wayne. I figured it out, and i understand that
what i'm doing isn't the best way to go about things. can
you help me in structuring a query for this information?
let me know what info you need from me.

thanks,
jason
-----Original Message-----
Yes, but don't. You shouldn't need to store information you can calculate.

Now, how to do it. The simplest method is probably to add another, hidden (Visible=No)
textbox that is bound to the field. In the BeforeUpdate
event of the form, set the value
of this textbox to the value of your calculated textbox.

There are other ways if this doesn't work for you. But,
as mentioned to begin with, it is
 
To start with, what information do you want in the query? What are the names of the tables
and the fields in each?
 
Back
Top