Link to home
Start Free TrialLog in
Avatar of H-SC
H-SCFlag for United States of America

asked on

change datasource for grid on timer event

I have a form that has a gridview on it.  I would like to have a timer event that fills the datagrid with dataset1 and then on timer next fire would fill datagrid with dataset2
Here is the code that I used in access for this same procedure...

Static B As Boolean
If B Then [Forms]![myform1].Form.RecordSource = "rs" Else [Forms]![myform1].Form.RecordSource = "rs2"
B = Not B
ASKER CERTIFIED SOLUTION
Avatar of MrRobot
MrRobot
Flag of Türkiye 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
oops, it should be

static b as boolean

instead of

dim b as boolean
Avatar of H-SC

ASKER

rob,

many thanks for the response... this works perfect!!  Also if I wanted to apply this same code to the datasource of a form, how would that look?
you're welcome =)

a form doesn't have a datasource, but I think you mean datasource of a grid on another form, than the code will simply be;

myForm.myGrid.datasource

Avatar of H-SC

ASKER

sounds great rob....many thanks again