Hello everybody! I'm currently creating my first employee monitoring system here in Visual Basic 6. I have a problem with regards to my program, it has an error of no value given for one or more parameters. The code that I will show here is just a part of my program (a form specifically). Please help me guys!

Private Sub Combo1_Click()
If Combo1.Text = "Employee_Name" Then
Adodc1.RecordSource = "Select Employee_Name from Table1"
Adodc1.Refresh
End If
If Combo1.Text = "Employee_ID" Then
DataGrid1.DefColWidth = "1900"
Adodc1.RecordSource = "Select Employee_ID from Table1"
Adodc1.Refresh
End If
If Combo1.Text = "Employee_Position" Then
Adodc1.RecordSource = "Select Employee_Position from Table1"
Adodc1.Refresh
End If
If Combo1.Text = "Employee_Address" Then
DataGrid1.DefColWidth = "5900"
Adodc1.RecordSource = "Select Employee_Address from Table1"
Adodc1.Refresh
End If
If Combo1.Text = "Employee_Age" Then
DataGrid1.DefColWidth = "1900"
Adodc1.RecordSource = "Select Employee_Age from Table1"
Adodc1.Refresh
End If
If Combo1.Text = "Employee_Gender" Then
Adodc1.RecordSource = "Select Employee_Gender from Table1"
Adodc1.Refresh
End If
If Combo1.Text = "Employee_ContactNo" Then
DataGrid1.DefColWidth = "2200"
Adodc1.RecordSource = "Select Employee_ContactNo from Table1"
Adodc1.Refresh
End If
End Sub

Private Sub Form_Load()
With DataGrid1
        .Columns(0).Width = "1500"
        .Columns(1).Width = "1900"
        .Columns(2).Width = "5900"
        .Columns(4).Width = "1500"
    End With
Combo1.AddItem ("Employee_Name")
Combo1.AddItem ("Employee_ID")
Combo1.AddItem ("Employee_Address")
Combo1.AddItem ("Employee_ContactNo")
Combo1.AddItem ("Employee_Age")
Combo1.AddItem ("Employee_Gender")
Combo1.AddItem ("Employee_Position")
End Sub

By the way the error appears everytime i'm going to click/select the Employee_Gender in the combobox, where supposed to be it should display the column Employee_Gender and its corresponding values.

The error warns you that no value was given OR returned. Maybe there is no value under Employee_Gender but you are making a call to it. Check your database to see if there is values available to show.

I already solved the problem. I just saved my database with other filename and changed the field name of the gender then rebuilded my connection with adodc that's it. Thank you anyway AndreRet for your suggestion! :)

commented: Well done angel, it was only a pleasure. Some kudos for you +12

Well done angel, it was only a pleasure. Some kudos for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.