combo box

campo88

Registered User.
Local time
Today, 19:03
Joined
Nov 20, 2009
Messages
46
I have a 3 combo boxes each with numbers that are to be selected.

when trying to sum the values of the combobox using vba it does not work. Can any1 help. My code is below:

Code:
Private Sub Submit_Click()
Dim Total As Single

Total = (Me.combobox1.Value) + (Me.combobox2.Value) + (Me.combobox3.Value)

MsgBox (Total)

End Sub

I get a runtime error 6 overflow message. Whatever that means!
 
You may have a NULL value in your field

Try Total = NZ(Me.combobox1.Value,0) + NZ(Me.combobox2.Value,0) + NZ(Me.combobox3.Value,0). This will give you a zero value for a Null value.
 
Hi

Total = NZ(Me.combobox1.Value,0) + NZ(Me.combobox2.Value,0) + NZ(Me.combobox3.Value,0)

Gave me the same error :(
 
What is being stored in the bound column of the Combo Box? As this is currently what is being totalled? Is it the bound column or another column that you wish to total?
 
row source - 10;20
row source type - value list
bound column - 1
column count - 1
 
Any chance you could post a copy of the DB as I'm unable to replicate the error :confused:
 

Users who are viewing this thread

Back
Top Bottom