Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MSFlexGrid and ADO
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00412017
Message ID:
00412177
Vues:
15
>I'm trying to use a MSFlexGrid with an ADO recordset and I keep getting the error "Object variable or With Block variable not set"????
>
>Here is the code:
>
Set grdbasins1.DataSource = rsBasins
>
>rsBasins does exist, and if I change to grid to a DataGrid it works fine!
>
>Any ideas?

I have an app where I use a pair of thos grids to allow my QA dept to validate data in a read only way. I do use data controls and allow them to select their tables. Code follows: I rarely use data controls anymore but here it is anyway. HTH BTW If you do not refresh the data control it will not reflect your new table info.
Private Sub cmdGetDataSource1_Click()
    Dim strDatabase
    'wild stuff here.
    strDatabase = GetDatabase() ' this is a UDF common dialog
    txtdata1.Text = strDatabase ' Display for the user
    datTable1.DatabaseName = GetPath(strDatabase) ' important
    datTable1.RecordSource = GetBaseFileName(strDatabase) ' important
    datTable1.Refresh ' important' important' important
    MSFlexGrid1.Refresh ' important
    MSFlexGrid2.Refresh ' maybe overkill
End Sub

Private Sub cmdGetDataSource2_Click()
    Dim strDatabase
    'wild stuff here.
    strDatabase = GetDatabase() 
    txtData2.Text = strDatabase
    datTable2.DatabaseName = GetPath(strDatabase)
    datTable2.RecordSource = GetBaseFileName(strDatabase)
    datTable2.Refresh
    MSFlexGrid1.Refresh
    MSFlexGrid2.Refresh
End Sub
 
~Joe Johnston USA

"If ye love wealth better than liberty, the tranquility of servitude better than the animated contest of freedom, go home from us in peace. We ask not your counsel or arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that ye were our countrymen."
~Samuel Adams

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform