Link to home
Start Free TrialLog in
Avatar of Audsimous
Audsimous

asked on

REfreshing a datagrid attached to a command

Here's the buig thing.

I want to attached dynamic filters to a datagrid.

As the user modifies those filters, I change the sql command of the command attached to the grid.

But the grid wont refresh...

How do I refresh it ???

I tried to execute the command, but i receive an error tellin me the object is open...
Avatar of hes
hes
Flag of United States of America image

If you are using the adodc1 then change the
adodc1.recordsource and then
Adodc1.Refresh
Avatar of Audsimous
Audsimous

ASKER

not using an adodc object... directly attached to a dataenvironnement
not using an adodc object... directly attached to a dataenvironnement
ASKER CERTIFIED SOLUTION
Avatar of hes
hes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
not using an adodc object... directly attached to a dataenvironnement
Still does'nt work... :

        If cboRegionMemo <> "Toutes" Then
            If Right(strCritere, 6) <> " WHERE" Then strCritere = strCritere & " AND "
            strCritere = strCritere & " region = '" & cboRegionMemo & "' "
        End If
        If Right(strCritere, 6) <> " WHERE" Then dataServices.Commands(2).CommandText = dataServices.Commands(2).CommandText & strCritere
       
        'REfresh
        dataServices.Commands(2).CommandText = dataServices.Commands(2).CommandText & " ORDER BY interne"
        dgServices.DataMember = "cmdMemos"
        dataServices.rscmdMemos.Requery
        Set dgServices.DataSource = dataServices


--------------------------

Plz fix
Finally... thx!