How to get a total using a combo box?

Gerryw

Registered User.
Local time
Today, 19:46
Joined
Jun 20, 2003
Messages
13
I have a form which has 7 combo box fields named 'MonHrs - TueHrs - WedHrs' etc. through to 'SunHrs' and I have a table (tblHrsWorked) which contains 8 (The 1st field is the primary field - Autonumbered - and the other 7 fields is a number field. Each field contains the numbers 1 to 12 (representing the hours per day) and they can be picked from 7 combo boxes in the 'frmTutorsInvoice' form I have made.

After I have entered the numbers, I want the total of all 7 fields of the tblHrsWorked to be totalled up in a text box/combo box field named 'WkTotalHrs'. I have set the properties data control source to; =[MonHrs]+[TueHrs]+[WedHrs] and so on to '+[SunHrs] but when I run the form and pick from the list of numbers in the combo/text boxes 'WkTotalHrs' combo/text box has an error showing saying '#NAME?' and I just cannot find a way to make it work. I have said that I was using a combo/text box for totalling the other 7 fields andI have tried to use both types without success.

Can you help me? I f you need more info, please ask?

Gerry
 
Last edited:
Are the numbers in the combo boxes a text data type? You can try using CInt and see if that works.
 

Users who are viewing this thread

Back
Top Bottom