hi, im kinda new, in fact i just signed up hoping you guys could help me. if i have multiple data grids connecting to multiple tables in access, one with all check boxes, can i make one of the data grids be affected by the other, like when i select a row on one, the other will change its rows to match the first ones rows?
ill check back tomarrow because i dont know how quick you guys answer yet, pls help me, if you need more info just let me know and ill post more about it tomarrow.


p.s. thanks in advance

Recommended Answers

All 4 Replies

are you mean that when the row of datagrid selected then other datagrid will change agree with the selected point??
if my question is right one, you can use click event to do this. when datagrid is selected you will specify the row that you want to use as key to show a new data in other datagrid.

yes thats worect, but how do i specify which row affects what, also if you dont mind, i thought i at least had my datagrid/databases save but now its not working, what am i doing wrong, i have this line of code
oledbdataadapter1.update(dataset1)
last night it worked for saving, now its not.

btw, thanks for answering me, the help is really appreciated

i use this code to specify the row which i use as key :

Dim i As Integer

 i = datagridName.CurrentRowIndex()

the code will get the row index, so you can use the index to get data in the row and use as key to show data in other datagrid.

this ex from me, you adapted with your own project :

"SELECT * FROM Users where Id_User ='" & Trim(datagridName.Item(i, 0)) & "'"

hope this helps.

i understand the first one (somewhat) and dont understand the 2nd one at all but it does help a little, it lead me to another track, sry if it wasted your time, but after trying your way, i thought of something, i first went into the oledbdataadapter and reconfigured and when doing the quiery, after the FROM table, i put a enter then
WHERE ([Person_ID]=parameter1)
then set the dataadapter's select parameter and in the code i put
dataadapter2.selectcommand.parameter(0).value=txtPerson'sID.text
and it seamed to work, now if only i can figure out how to make the changes that i do to the data grid save on the access form, right now im using
dataadapter1.update(dataset1) and it works like 10% of the time:( any ideas? ill w8 to ask my other questions later, i have a couple more, sry if im bothering any of you who are reading this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.