=val unbound control not calcualting properly

benjee

Personal Jesus
Local time
Today, 11:51
Joined
Mar 19, 2003
Messages
53
Hey,

I had a calculating problem with a subform that Rich fixed. The fix that Rich gave me contained 1 list box and when i edited & implemented the code onto my form it worked ace.

However i now want to add another list box, and use its value as another variable in my subtotal. Look at the attachment (amended version of Richs form) to gain a better understanding of the problem but the Subtotal code is : -

=Val([Text2]+[Text4]+[Text6]+[Text8])*[List0].[Column](1)+[Combo13].[Column](1)

When i open the form and try and perform a calculation only values from one list/combo box is being incremented in the subtotal.
:confused:

any ideas folks
 

Attachments

Just a quick guess without downloading - are you sure that you are wanting Column(1) from the new combobox, and not Column(0) ?
 
hi,

even with column 0 is doesn't calculate.
 
When posting a database it's probably best to do one of two things:

i) State which version it is as a lot of people still use Access '97 and waste time downloading them only to find that they can't be opened;

ii) Use the ability of Access 2000 or 2002 to convert the database to Access '97 so all potential helpers can download the database and have a look.

In work I use '97 and can't view what you posted.
 
Apologies Mile...

Here is the converted db,

Hope it works.
 

Attachments

Here's your ControlSource:

=(Val([Text2]+[Text4]+[Text6]+[Text8])*[List0].[Column](1))+[Combo13].[Column](1)
 
but when you look at the actual subtotal is still doesn't equate with the variables you enter.

for example : 20(flemish) + 20(facebrick) * 10 is giving = £220 and not £400!
 
Sorry my blindness:

You had Val([box 1] + [box 2] + [box3] + [box 4])

which if the boxes were 1, 4, 5, & 3 respectively the result would have been: 1453 rather than 13 as each control needs to go through the Val function.

Likewise with your comboboxes.

=(Val([Text2])+Val([Text4])+Val([Text6])+Val([Text8]))*(Val([List0].[Column](1))+Val([Combo13].[Column](1)))
 
thats great thanks,

one small question on loading the form is there any way to prevent '#Error' being displayed in the SubTotal.

When you start entering numbers though it works fine.
 

Users who are viewing this thread

Back
Top Bottom