473,397 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Mshflexgrid control (Copy entire Row from one to another)

I m working on project. The idea is, select 1 row and add to another Msflexgrid. Instead of 20 rows i might want to select 5 or 10 rows only from Mshflexgrid1 to be add in Mshflexgrid2.

coding bellow manage to copy all the rows form Mshflexgrid1 to Mshflexgris2.

WRow as Long
Dim WCol as Long

MSHF2.Clear
MSHF2.Rows = MSHF1.Rows
MSHF2.Cols = MSHF1.Cols

For WRow = 1 to MSHF1.Rows -1
MSHF1.Row = WRow
MSHF2.Row = WRow
For WCol = 0 to MSHF1.Cols - 1
MSHF1.Col = WCol
MSHF2.Col = WCol
MSHF2.Text = MSHF1.Text
Next WCol
Next WRow


But what i need is to select certain row form MSHF1 and copy the entirerow into MSHF2 which is control by different ADO.

Somebody please help me.
Jun 5 '07 #1
1 3492
PdBeer
5
I'm not sure if this will be the most efficient way of doing it, but you can try.

Use the MSHFlexgrid_click sub and get the row number that was clicked by using MSHFlexgrid.row. Then search the ADOR recordset to the (MSHFlexgrid.row-1) indexed record. Add a record to the other ADOR recordset and read the data field by field into the new record.

For example: (Say temp1 is the one recordset and temp2 the other)

Private Sub MSHFlexGrid1_Click()
temp1.MoveFirst
For i = 1 To MSHFlexGrid1.row - 1
temp1.MoveNext
Next
temp2.addnew
For i=0 to MSHFlexGrid1.col-1
temp2.fields(i).value = temp1.fields(i).value
Next
End Sub
Jun 5 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: dave | last post by:
I've designed a nice little App that works something like a spreadsheet using the MSHFlexgrid control. Many users are inclined to press the tab key, expecting the program to respond like excel...
4
by: mc | last post by:
HI, I face a problem on using MSHFlexGrid currently. I have developed a grid using the MSFlexGrid control at office, it does work at my office machine. Later, I copy the whole source code...
4
by: doller | last post by:
Hi Dear , I have a mshflexgrid control on the VB form having 200 rows .I need to add a row before or after the selected row in the grid. As wee do in excel we can add rows before or after...
0
by: nairda | last post by:
Hello all! I have a problem combining 2 tables from excel to my MSHFlexgrid. I've succeeded to show an excel table in my MSHFlexgrid using clipboard, but then I have to add a view columns from...
4
by: nairda | last post by:
Hi, I have a minor trouble in my program. I've one MSHFlexgrid to show all datas from an input form that I made. The problem occurs when I deleted one or more rows in the MSHFlexgrid and would like...
0
by: Vincent | last post by:
I am using the well known technique of superimposing a text box control on top of a mshflexgrid to achieve text input on this unbound control. However, there is one problem that really irks me. ...
2
by: WhiteShore | last post by:
hi there just wonder is it possible to save all the data item from mshflexgrid that has been retrieved from another table? let say i got 1 table called A and has been retrieved by mshflexgrid,...
1
by: kunudesai | last post by:
i have a data in list box OR in mshFlexGrid control. i want to write that data into .ini file using vb6.0 how can i do it. my data is like GJ 21 E 6943 GJ 06 AC 1432 Invalid...
2
Fary4u
by: Fary4u | last post by:
Hi it's my 1st post in VB, i'm trying to get data from ComboBox & result with MSHFlexGrid it's working fine there is no problem they only thing i need is Another ComboBox & ( result...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.