|
-
Aug 3rd, 2000, 09:10 AM
#1
Thread Starter
Evil Genius
I would be very grateful for ANY assistance with the following, Thank you
everyone!
I have a flexgrid control, which shows 2 columns(which are taken from an Access 97 database table,showing a product, and the cost for the product).
The user can edit these (via a textbox & flexgrid cells), but I want them to be able to click onto a button and the changed data from the flexgrid to be changed within the access table (both columns by the way are from the same table in the access database).
I am trying to use something like the following I only have RS2 as only 1 of the columns [the cost] needs to be updated):
Dim x As Integer
x = 1
Do Until Rs2.EOF
Rs2.Edit
Rs2!Cost = FlxGrd.RowData(x)
x = x + 1
Rs2.Update
Rs2.MoveNext
Loop
With the above, I am trying to loop through each of the entries within the flexgrid column and place these in the database, only very badly.
The above does not work, however I change it. I am fairly new to the flexgrid, but going by DAO, I think my problem lies in :
a) telling VB to look / take the data to copy from the second column of the flexgrid (which I have not put above, as I am unsure of how to do this),
b)I think the "FlxGrd.RowData(x)" part is possibly a wrong way to go about this, I noticed you cannot have a "flexgrid!column2" type of code as you would with a recordset, could you tell me what to use here please?
Thank you for your help!
Alex Read
-
Aug 3rd, 2000, 09:30 AM
#2
You can use the TextMatrix property, in it you can specify a Row and a Col property and then you get the value in the given field.
Code:
Debug.Print MSFlexGrid1.TextMatrix(iRow, iCol)
Where iRow would be the row you are looking for, and iCol would be 1(second colomn, flexgrid is 0 based).
Hope it helps.
-
Aug 3rd, 2000, 09:39 AM
#3
Thread Starter
Evil Genius
I cannot thank you enough for that!! I have been looking everywhere.
Thankyou!!!!!!!!!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|