Try this:
BTW, a data type converstion error is where you are trying to pass something that doesn't have the same value type as the object you are trying to pass it into.
What is the value in combobox [contact_no]. I assumed from your previous posts it was the table name. If not, what is it?
Mary
Code:
Function Correspondence_list() Dim qdf As QueryDef Dim strSQL As String Dim DB As Object Set DB = CurrentDb Set qdf = DB.QueryDefs("Doc_Corres_Query") strSQL = "SELECT EE_Ref_no AS [EE Ref#], Trim_Ref_no AS [Trim Ref#], Subject, Correspondence_from AS Correspondence," & _ "FROM " & [contract_no] & ";" qdf.Execute strSQL qdf.Close End Function
BTW, a data type converstion error is where you are trying to pass something that doesn't have the same value type as the object you are trying to pass it into.
What is the value in combobox [contact_no]. I assumed from your previous posts it was the table name. If not, what is it?
Mary
Comment