How to compare amounts between input field and listbox?

xwnoob

Registered User.
Local time
Today, 10:18
Joined
Nov 7, 2011
Messages
70
How do i compare a value for a input field against a value in a column in a listbox.

This is my code but currently nothing happens. I want to make sure drawdownamt does not exceed the listbox column 3 amount.

Code:
Private Sub DrawdownAmt_BeforeUpdate(Cancel As Integer)
If Me.DrawdownAmt > Me.ListFacility.Column(3) Then
MsgBox ("WARNING:You have entered an amount larger than total amount!")
Cancel = True
Me.DrawdownAmt.Undo
End If
End Sub
 
Note that the column of a listbox (or combo box) starts from 0. Column 3 is not the third column, it's the 4th column. If you want to refer to the third column use 2.
 
Note that the column of a listbox (or combo box) starts from 0. Column 3 is not the third column, it's the 4th column. If you want to refer to the third column use 2.


Sorry i meant 4th column....not 3rd column. But i still cant find a solution...my 4th column is a number but it still doesnt work.
 

Users who are viewing this thread

Back
Top Bottom