0

I have a datagrid on the form bind with recordsets. I need to know if is it possible to assign that datagrid object into a variable?

I have created a preliminary code but its not working

dim dbgridvar as DataGrid

Private Sub Assign_Click()
set dbgridvar=Form1.Datagrid1
End Sub

Thank you for helping!

2
Contributors
2
Replies
5
Views
2 Years
Discussion Span
Last Post by blocker
0

I can't test this out because I don't have anything older than vb.net 2010 but I don't believe you need the Set keyword. Try just

dbgridvar = Form1.Datagrid1

Are you getting an error message?

0

thank you Reverend Jim!

It seems that my code is correct but the problem is I have declared it as private in my module and I tried to access it in a form..

Thanks.. Solved!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.