I've got to be doing something pretty dumb here and hope someone will grade my card to see what is missing.
I am using SQL to assign a recordset to a listbox. The code looks like this:
Dim Table_Name As String
Table_Name = "[Lookup:" & lbl_1.Caption & "]"
lstTask_List.RowSource = "SELECT " & Table_Name & ".Task, " & _
Table_Name & "." & OG_abbrev & " " & _
"FROM " & Table_Name & " " & _
"WHERE " & Table_Name & "." & OG_abbrev & "=True " & _
"ORDER BY " & Table_Name & ".Priority"
When printed in the debug window, it looks like this:
SELECT [Lookup:Walls].Task, [Lookup:Walls].Bed
FROM [Lookup:Walls]
WHERE [Lookup:Walls].Bed=True
ORDER BY [Lookup:Walls].Priority
When compared with the SQL view of a query, shown below, it looks pretty darn good:
SELECT [Lookup:Walls].Task, [Lookup:Walls].Bed
FROM [Lookup:Walls]
WHERE ((([Lookup:Walls].Bed)=True))
ORDER BY [Lookup:Walls].Priority;
In fact, I just canot figure it out!!!! The query runs and returns the correct data. If I assign the query to the RowSource, I still get no display. Thats why I think I'm overlooking something simple.
So here are the properties of the listbox. If I have omitted one of importance, please let me know.
Name: lstTask_List
RowSourceType = Table/Query
ColumnCount = 2
ColunmWidths = 2.75";0"
BoundColumn = 1
Visible = Yes
Width = 3.0625"
Well, that is about the jist of it. Any thoughts????
Regards, Sorrells
I am using SQL to assign a recordset to a listbox. The code looks like this:
Dim Table_Name As String
Table_Name = "[Lookup:" & lbl_1.Caption & "]"
lstTask_List.RowSource = "SELECT " & Table_Name & ".Task, " & _
Table_Name & "." & OG_abbrev & " " & _
"FROM " & Table_Name & " " & _
"WHERE " & Table_Name & "." & OG_abbrev & "=True " & _
"ORDER BY " & Table_Name & ".Priority"
When printed in the debug window, it looks like this:
SELECT [Lookup:Walls].Task, [Lookup:Walls].Bed
FROM [Lookup:Walls]
WHERE [Lookup:Walls].Bed=True
ORDER BY [Lookup:Walls].Priority
When compared with the SQL view of a query, shown below, it looks pretty darn good:
SELECT [Lookup:Walls].Task, [Lookup:Walls].Bed
FROM [Lookup:Walls]
WHERE ((([Lookup:Walls].Bed)=True))
ORDER BY [Lookup:Walls].Priority;
In fact, I just canot figure it out!!!! The query runs and returns the correct data. If I assign the query to the RowSource, I still get no display. Thats why I think I'm overlooking something simple.
So here are the properties of the listbox. If I have omitted one of importance, please let me know.
Name: lstTask_List
RowSourceType = Table/Query
ColumnCount = 2
ColunmWidths = 2.75";0"
BoundColumn = 1
Visible = Yes
Width = 3.0625"
Well, that is about the jist of it. Any thoughts????
Regards, Sorrells