Recordset Change Code Yeilds Error or All Records 
Author Message
 Recordset Change Code Yeilds Error or All Records

This morning I received a Visual Basic tip from the list server I am
subscribed to indicating that using .refresh on a grid bound to an data
control does not work due to a bug in VB6 SP3 (what I have).  Using the code
in the tip I was able to fix the problem.  The revised sub rountine is as
follows:

Sub SetupDataControl()
'define variables
Dim FilterString As String

'intialize variables
FilterString = "Domain = " & "'" & cboDomains.Text & "'"

'change recordset of adocPopAccounts to show pop accounts for selected
domain
adocPopAccounts.CommandType = adCmdText
adocPopAccounts.Recordset.Filter = FilterString
adocPopAccounts.Recordset.Requery
Set dbgrdPopAccounts.DataSource = adocPopAccounts
End Sub

The secret is to requery the recordset of the adoc control and rebind it to
the data grid after updating it to include the correct records.



Mon, 13 May 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. recordset record position change upon the Datacombo change...

2. recordset record position change upon the Datacombo change...

3. recordset record position change upon the Datacombo change...

4. TransferDatabase Command Yeilds Error

5. Printer.Print Yeilds Divide By Zero Error

6. Printer.Print Yeilds Divide By Zero Error

7. Module-level multiple-record recordset vs temp single-record recordset

8. Module-level multiple-record recordset vs temp single-record recordset

9. Changed at run-time recordset only shows 1 record rather than many

10. Recordset, changed at runtime, only shows 1 record

11. Changing Current Record of Related RecordSet

12. Hyperlink color changes if I click on one record of a recordset

 

 
Powered by phpBB® Forum Software