Calculations using drop down menus

A

Alex

Is it possible to use values (i.e. numbers) to calculate totals? I have
created a a field with a drop down menu of 3 numbers. I then try and multiply
the value selected in the drop down menu with a number that i physically
input into another field, and all that happens is the physical input is
multiplied by either 1, 2 or 3, depending on whether the values in the drop
down menu are 1st, 2nd or 3rd in the list. How can I make the visible number
in the menu be the active one in the calculation?
 
W

Wayne-I-M

If you have 2 text boxes and a combo
txt1, txt2 and cbo1

Input the number into txt1
select a number from cbo1

use this AfterUpdate of cbo1

Private Sub cbo1_AfterUpdate()
Me.txt2 = Me.txt1 * Me.cbo1
End Sub

The calculated result will be shown in txt2
 
A

Alex

when I do this, a window appears saying that the macro.....

Private Sub cbo1_AfterUpdate()
Me.txt2 = Me.txt1 * Me.cbo1
End Sub

......cannot be found. How can I get around this?

Thanks
 
W

Wayne-I-M

There is no macro ?

Do you have a control that you are inputtting a number into ? can you post
the name of this control (right click and open the properties box. Look at
the top of the Other column in the row marked Name)

Do you have a combo box with some number in - can you post the name of the
combo and also can you post the source - right click the combo and open the
properties box - the source is in the data column in the row mark Row Source
- cut and paste this here so we can see it. Make sure the row mark Row
Source Type is a Value List)

Do you have a text box where you want to calculated result to be shown - can
you post the name of this control.
 

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