Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Clicking a datagrid

Posted on 2004-10-21
Medium Priority
Last Modified: 2010-05-02
I have 2 datagrids, first one is bound to a table in the db, the second one is populated depending on the row clicked in the first datagrid.  I use one of the columns in the first datagrid to store the id of the record and I use this to create the rs for the second datagrid
Now if I click the fixed col on the first datagrid then the second datagrid is updated with the related records for that record.  If I double click anywhere in a row then the second datagrid is updated fine again.
But if I just click a cell once, it pulls the index from another row?
What am I doing wrong?
Question by:Gary
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

Noel_Castillo earned 1000 total points
ID: 12377591
You must do the updating of the second datagrid on RowColChange event of the first datagrid. That ensures updates are done after the record pointer has moved:)

Expert Comment

ID: 12377941
I'd encountered this before. i used other mouse event of the first grid and found out that my code executes right before the record goes to the row i clicked. The previous record position was the one being used instead of the row i clicked.:)

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question