Hi,
I am trying to take the records that are created in the first table, that I create here ( which does work), and enter the records into a listbox. With all the things I tryed I did once get the first rcord in, but that was it; and now I cannnot seem to gret that anymore. Any idesas on what I am soing wrong here, would be appreaciated.
Thank You
Here is the code I have so far.
Dim sList As String
Dim sQuery As String
Dim r1 As Recordset
On Error Resume Next
Err.Number = 0
CurrentDb.Execute ("DROP TABLE [testTable]")
Err.Number = 0
CurrentDb.Execute ("SELECT [Survey database].Customer, [Survey database].User, [User Id].Name, [Survey database].Department INTO testTable FROM [Survey database] INNER JOIN [User Id] ON [Survey database].User = [User Id].[User ID]WHERE [User Id].[User ID] = '" & [Combo2] & "'")
Set r1 = CurrentDb.OpenRecordset("SELECT [Survey database].Customer, [Survey database].User, [User Id].Name, [Survey database].Department FROM [Survey database] INNER JOIN [User Id] ON [Survey database].User = [User Id].[User ID]WHERE [User Id].[User ID] = '" & [Combo2] & "'")
Do Until r1.EOF
Me!lstOPut.RowSourceType = "Tables/Query"
Me!lstOPut = r1!Customer & "" & r1!User &" "& r1!Name &" "& r1!Department
Me!lstOPut.Requery
Loop
I am trying to take the records that are created in the first table, that I create here ( which does work), and enter the records into a listbox. With all the things I tryed I did once get the first rcord in, but that was it; and now I cannnot seem to gret that anymore. Any idesas on what I am soing wrong here, would be appreaciated.
Thank You
Here is the code I have so far.
Dim sList As String
Dim sQuery As String
Dim r1 As Recordset
On Error Resume Next
Err.Number = 0
CurrentDb.Execute ("DROP TABLE [testTable]")
Err.Number = 0
CurrentDb.Execute ("SELECT [Survey database].Customer, [Survey database].User, [User Id].Name, [Survey database].Department INTO testTable FROM [Survey database] INNER JOIN [User Id] ON [Survey database].User = [User Id].[User ID]WHERE [User Id].[User ID] = '" & [Combo2] & "'")
Set r1 = CurrentDb.OpenRecordset("SELECT [Survey database].Customer, [Survey database].User, [User Id].Name, [Survey database].Department FROM [Survey database] INNER JOIN [User Id] ON [Survey database].User = [User Id].[User ID]WHERE [User Id].[User ID] = '" & [Combo2] & "'")
Do Until r1.EOF
Me!lstOPut.RowSourceType = "Tables/Query"
Me!lstOPut = r1!Customer & "" & r1!User &" "& r1!Name &" "& r1!Department
Me!lstOPut.Requery
Loop