Avatar of Wilder1626
Wilder1626
Flag for Canada asked on

VB6 - Transfer from MSHFlexgrid to another

Hi,
I need your help for what I would like to do bellow.

In my MSHFlexgrid1, I may have a huge volume of rows and columns. But in column 9, I have IDs.
What I need to do is to transfer in MSHFlexxrid3 all rows and columns. But every time a value will show in column 9 that match column 0 from MSHFlexgrid2, when it will transfer into MSHFlexgrid3, it needs to change the value from column 9 only with the SUB_ID in column 1 from MSHFlexgrid2. All the other details must stay the same. So far, this is not a problem.

Where it gets more complicated is if a single value from column 9 may show more than once in column 0 from MSHFlexgrid2. When that happens, it must be clone into a new row so that both SUB_ID are transfer in MSHFlexgrid3. If I have 3 match, then it should clone it 3 times with each SUB_IDs.

Example:
transfert_no1
The value 12 shows twice in MSHFlexgrid2 with 2 different SUB_IDs. So it needs to create a record of each like below:
transfer_no2
ow can i do that?

Thank you for your help.
Visual Basic Classic

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon
Martin Liss

Please supply a sample project.
Wilder1626

ASKER
Hi MartinLiss

Sorry. Forgot to put it the fist time.
Test-duplicate.zip
Martin Liss

I'm at a play and I'll look at it later this evening.
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Martin Liss

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Wilder1626

ASKER
That's exactly what i needed. Thanks again for your help.
Martin Liss

You're welcome and I'm glad I was able to help.

In my profile you'll find links to some articles I've written that may interest you.

Marty - MVP 2009 to 2015, Experts-Exchange Top Expert Visual Basic Classic 2012 to 2014