aziz rasul
Active member
- Local time
- Today, 08:46
- Joined
- Jun 26, 2000
- Messages
- 1,935
I have a list box on a tabbed control. On pressing a command button on the form and making the tab control visible, the following code is implemented
I tried placing
Me!List72.Requery
before and after the SQL statement. No affect. I then placed the same requery code elsewhere. Still no luck. Here's the whole part of the code: -
Me!TabCtl52.Visible = True
For index = 0 To tdfcount - 1
If dbs.TableDefs(index).Name = "tblMissing GL Codes Retail" Then
Set rst4 = dbs.OpenRecordset("tblMissing GL Codes Retail")
Me!List72.Requery
strSQL = "SELECT [tblMissing GL Codes Retail].OUC, [tblMissing GL Codes Retail].[GL Code], "
strSQL = strSQL & "[tblMissing GL Codes Retail].Year, [tblMissing GL Codes Retail].Period FROM "
strSQL = strSQL & "[tblMissing GL Codes Retail] ORDER BY [tblMissing GL Codes Retail].Year, [tblMissing GL Codes Retail].Period;"
Me!List72.Requery
Me!List72.RowSource = strSQL
Me!List72.Requery
Me!TabCtl52.Pages![Missing GL Codes].Caption = "Missing GL Codes"
Me!List72.Requery
Exit For
Else
Me!List72.RowSource = ""
End If
Next index
If I place a breakpointwithin the code, I am able to see all the records in the list box. However if I don't halt the code, I don't see ALL the records appearing in the list box.
Can anyone explain why this happens?
I tried placing
Me!List72.Requery
before and after the SQL statement. No affect. I then placed the same requery code elsewhere. Still no luck. Here's the whole part of the code: -
Me!TabCtl52.Visible = True
For index = 0 To tdfcount - 1
If dbs.TableDefs(index).Name = "tblMissing GL Codes Retail" Then
Set rst4 = dbs.OpenRecordset("tblMissing GL Codes Retail")
Me!List72.Requery
strSQL = "SELECT [tblMissing GL Codes Retail].OUC, [tblMissing GL Codes Retail].[GL Code], "
strSQL = strSQL & "[tblMissing GL Codes Retail].Year, [tblMissing GL Codes Retail].Period FROM "
strSQL = strSQL & "[tblMissing GL Codes Retail] ORDER BY [tblMissing GL Codes Retail].Year, [tblMissing GL Codes Retail].Period;"
Me!List72.Requery
Me!List72.RowSource = strSQL
Me!List72.Requery
Me!TabCtl52.Pages![Missing GL Codes].Caption = "Missing GL Codes"
Me!List72.Requery
Exit For
Else
Me!List72.RowSource = ""
End If
Next index
If I place a breakpointwithin the code, I am able to see all the records in the list box. However if I don't halt the code, I don't see ALL the records appearing in the list box.
Can anyone explain why this happens?
Last edited: