Hello everyone, i've look at other posts about this, and i can't get it to work for my database.
I have a combo box called Employee_ID that is linked to a list box. the list box has a bunch of data that is being pulled from the EmployeeData table. im using the combo box to allow me to sort the listbox by the employee ID.
Here is my code:
Private Sub Employee_ID_AfterUpdate()
Dim strSQL As String
strSQL = "SELECT EmployeeData.[Employee ID], EmployeeData.Date_Day, EmployeeData.Date_Year, EmployeeData.Salary, EmployeeData.Project, EmployeeData.Department, EmployeeData.[Percent Allocated], EmployeeData.[Hours Logged] FROM EmployeeData WHERE EmployeeData" & Me.Employee_ID.Value
Me.List48.RowSource = strSQL
Me.List48.Requery
End Sub
when i run it in debug mode, i can see that it is getting the right record when i hover over the SELECT, but it's not setting it into strSQL. strSQL always = "" and i have no idea why. i thought maybe setting strSQL to String was wrong, so i tried setting it to Integer and still i got = ""
I have a combo box called Employee_ID that is linked to a list box. the list box has a bunch of data that is being pulled from the EmployeeData table. im using the combo box to allow me to sort the listbox by the employee ID.
Here is my code:
Private Sub Employee_ID_AfterUpdate()
Dim strSQL As String
strSQL = "SELECT EmployeeData.[Employee ID], EmployeeData.Date_Day, EmployeeData.Date_Year, EmployeeData.Salary, EmployeeData.Project, EmployeeData.Department, EmployeeData.[Percent Allocated], EmployeeData.[Hours Logged] FROM EmployeeData WHERE EmployeeData" & Me.Employee_ID.Value
Me.List48.RowSource = strSQL
Me.List48.Requery
End Sub
when i run it in debug mode, i can see that it is getting the right record when i hover over the SELECT, but it's not setting it into strSQL. strSQL always = "" and i have no idea why. i thought maybe setting strSQL to String was wrong, so i tried setting it to Integer and still i got = ""