Validating a combobox

13063154

Member
Joined
Aug 24, 2005
Messages
9
Location
Vanderbijlpark, Gauteng, SA
Programming Experience
Beginner
Hi

I know this seems like a stupid question, but can somebody please help!

I need to check that any value is selected in the combobox before i can allow the report to be generated. The reason for this is the combobox contains a value for the amnout of years an employee has worked. This value is used to highlight a column on the report. I tried using a boolean flag that changes to true when the selected index is changed, but this does not seem to have any affect.
 
VB.NET:
If ComboBox1.Text = Nothing Then
            MsgBox("Select a value!")
            Exit Sub 'Or function
        End If
 
Craig said:
VB.NET:
If ComboBox1.Text = Nothing Then
            MsgBox("Select a value!")
            Exit Sub 'Or function
        End If

Hi Craig

Thanks for your help, unfortunately this won't help because the combobox has a value from the previous year and this value must just be updated every year, but i need to validate that this update has occured in order to carry on!

Thanks
 
so if i understand correctly. You have a combobox which hold an integer value equating to the number of years an employee has worked. Before a report is generated this value needs to checked to see if it is the most up-to-date record?
If so then why check it just before the report is generated? It should be updated every passing calendar year.
 
The problem is that it is not based on the time an employee has worked but rather on the level that he has worked (it is a combobox with integer values) It refers to the type of work that he has done during the period, this is based on integer values between 1 and 5
 
So you need to check the current value in the combobox to ensure that it is correct and the time of the report being called? In whatever database you are using if you want to correlate two values in association with particular timespan then i would be thinking about using a timestamp in the database. This could then be checked for validity. Am i even on the right track here?
 
(resolved) validating combobox

vis781 said:
So you need to check the current value in the combobox to ensure that it is correct and the time of the report being called? In whatever database you are using if you want to correlate two values in association with particular timespan then i would be thinking about using a timestamp in the database. This could then be checked for validity. Am i even on the right track here?

Hi Craig

I resolved the issue
all i needed to do was to set a boolean value to check that the combobox value had been changed during the applications running time, if the boolean value was equal to true then the report could be generated

Thanks so much for your help!;)
 
Back
Top