Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox Values miltiplied ..How ?

Status
Not open for further replies.

AccDeveloper

Programmer
Jul 13, 2003
7
0
0
CA
Hi,

I know this is trivial but I stuck. How to multiply the values of 2 listboxes and assign the result to a textbox.

Any help is appreciated.


Dim Row1, Row2 As Integer
Row1 = Me.List272.ListIndex
Row2 = Me.List276.ListIndex


Me.Text290 = Me.List272.Column(0, Row1) * Me.List276.Column(0, Row2)

Seems not working

Thx,
Vic
 
Assuming only numeric bound columns
Assuming no multi select
try
dim lst1int as integer
dim lst2int as integer
if isnull(me.list1.value) or me.list1.value = "" or isnumeric(me.list1.value) = false then exit sub
ditto for list 2
lst1int = me.list1.value
lst2int = me.list2.value
me.textbox.value = cstr(lst1int * lst2int)
if numbers are too big or are decimal change variable type to long / single or double as appropriate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top