Multiple control sources for a text box

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.
 
W

Wayne Morgan

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.
 
J

Jason

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
 
W

Wayne Morgan

To start with, what information do you want in the query? What are the names of the tables
and the fields in each?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top