Results 1 to 30 of 30

Thread: Anybody heard of bookmarks (not in IE!!)?

  1. #1

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98

    Anybody heard of bookmarks (not in IE!!)?

    Hi there,

    I'm currently conversing a DOA application to an ADO application and here is one of the problems I encountered:
    Previously the DBgrid was used to show the data. Since that is an DOA component I use the MSHFlexgrid at the moment.

    There are a lot of procedures that use the Selbookmarks property of the DBgrid, and there is no such property for the MSHFlexgrid.

    Can anyone tell me what this property is normally used for and if there is a similar property for the MSHFlexGrid?


    If you need an example of the code let me know.


    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Bookmarks... used in bound recordsets to mark where the record was before the current record was changed. I think.

    Personally I don't use them and if you are converting to ADO from DAO, then you should be able to mimic the same thing.

    Firstly you need to find out exactly what the previous coder used it for. Paste chunk of code up if you can't seem to see what it means. Comeone should know the answer... whether they tell though


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Okey here's a sample of the code, I hope someone can tell me how to adjust this to ADO and tell me what this piece of code does. B.T.W. this code is behind a delete record button.

    VB Code:
    1. Case BUTTON_VERWIJDEREN
    2.     If rs.RecordCount <> 0 Then
    3.       If grdDataGrid.SelBookmarks.Count <= 0 Then
    4.         gsFormParm = CMD_DELRCD & "|" & rs![OpdrachtId]
    5.         frmProductieOpdrachten.Show
    6.         Me.Enabled = False
    7.       Else
    8.         If GeneralDialog(DIATYPE_OPERATORQ, Me.Caption, _
    9.                  "Weet u zeker dat u de geselecteerde productieorders wilt verwijderen?", "") = _
    10.                                         DIABUTTON_YES Then
    11.           ReDim arrCurrentSelection(grdDataGrid.SelBookmarks.Count - 1)
    12.           lNumberCurrentlySelected = grdDataGrid.SelBookmarks.Count
    13.           For iCnt = 0 To grdDataGrid.SelBookmarks.Count - 1
    14.             arrCurrentSelection(iCnt) = grdDataGrid.SelBookmarks(iCnt)
    15.           Next iCnt
    16.    
    17.           ' definieer hoogste en de laagste selectie plus de selectiegrootte
    18.           lBeginSelect = DEF_MAXNBR_PRODUCTIEORDERS + 1
    19.           lEindeSelect = 0
    20.           For iCnt = LBound(arrCurrentSelection) To UBound(arrCurrentSelection)
    21.            rs.Bookmark = arrCurrentSelection(iCnt)
    22.            If rs![OpdrachtId] < lBeginSelect Then 'lager dan de vorige waarde?
    23.              lBeginSelect = rs![OpdrachtId]
    24.            End If
    25.            If rs![OpdrachtId] > lEindeSelect Then ' hoger dan de vorige
    26.              lEindeSelect = rs![OpdrachtId]
    27.            End If
    28.          Next iCnt
    29.          'OMM 6-10-2000; Gewijzigd om alleen de Orders te selecteren
    30.          Set rsSelect = gdbsMainDB.OpenRecordset( _
    31.                  "SELECT * FROM ProductieOrders WHERE IsOrder = True ")
    32.          rsSelect.FindFirst "OpdrachtId=" & lBeginSelect
    33.          Do While (Not rsSelect.EOF) _
    34.                   And (lBeginSelect <= lEindeSelect)
    35.            'OMM 17-7-2000; Veranderd voor AS400 Koppeling
    36.            '               alleen rsSelect.Delete bestond
    37.            If CheckProductieOrderHasCharge(rsSelect![bonnummer]) Then
    38.              rsSelect.Edit
    39.              rsSelect![IsVerwijderd] = True
    40.              rsSelect.Update
    41.            Else
    42.              rsSelect.Delete
    43.            End If
    44.            rsSelect.MoveNext
    45.            lBeginSelect = lBeginSelect + 1
    46.          Loop
    47.          iSelectRegel = 1  ' New Id for the first Order
    48.          ' Eerst renumber
    49.          rsSelect.MoveFirst
    50.          Do While Not rsSelect.EOF
    51.            rsSelect.Edit
    52.            rsSelect![OpdrachtId] = iSelectRegel
    53.            rsSelect.Update
    54.            rsSelect.MoveNext
    55.            iSelectRegel = iSelectRegel + 1
    56.           Loop
    57.           rsSelect.Close
    58.           datPrimaryRs.Refresh
    59.         End If
    60.       End If
    61.     End If


    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Originally posted by WiseGuy
    VB Code:
    1. Case BUTTON_VERWIJDEREN
    2.     If rs.RecordCount <> 0 Then
    3.  
    4. [b]If there is [u]NO[/u] selected bookmarks (count less than or equal to 0) then set a form parameter.
    5. Shows a new form and disabled the current one
    6. [/b]
    7.       If grdDataGrid.SelBookmarks.Count <= 0 Then
    8.         gsFormParm = CMD_DELRCD & "|" & rs![OpdrachtId]
    9.         frmProductieOpdrachten.Show
    10.         Me.Enabled = False
    11.       Else
    12.  
    13. [b]
    14. Note I don't understand holland speak so I may be missing something ;)
    15. If you answer Yes, it creates an array of selected bookmarks.
    16. (Assuming that the selected records in the dbGrid would be the bookmarks)
    17. [/b]
    18.         If GeneralDialog(DIATYPE_OPERATORQ, Me.Caption, _
    19.                  "Weet u zeker dat u de geselecteerde productieorders wilt verwijderen?", "") = _
    20.                                         DIABUTTON_YES Then
    21.           ReDim arrCurrentSelection(grdDataGrid.SelBookmarks.Count - 1)
    22.           lNumberCurrentlySelected = grdDataGrid.SelBookmarks.Count
    23.           For iCnt = 0 To grdDataGrid.SelBookmarks.Count - 1
    24.             arrCurrentSelection(iCnt) = grdDataGrid.SelBookmarks(iCnt)
    25.           Next iCnt
    26.    
    27.           ' definieer hoogste en de laagste selectie plus de selectiegrootte
    28.           lBeginSelect = DEF_MAXNBR_PRODUCTIEORDERS + 1
    29.           lEindeSelect = 0
    30.  
    31. [b]Looks like a loop through all array entries ...
    32. Moves to the first bookmark (selected record)
    33. Compares the start ID (currently max number of record +1)(see above) and either sets the beginning or End IDs
    34. [/b]
    35.           For iCnt = LBound(arrCurrentSelection) To UBound(arrCurrentSelection)
    36.            rs.Bookmark = arrCurrentSelection(iCnt)
    37.            If rs![OpdrachtId] < lBeginSelect Then 'lager dan de vorige waarde?
    38.              lBeginSelect = rs![OpdrachtId]
    39.            End If
    40.            If rs![OpdrachtId] > lEindeSelect Then ' hoger dan de vorige
    41.              lEindeSelect = rs![OpdrachtId]
    42.            End If
    43.          Next iCnt
    44.  
    45.  
    46.          'OMM 6-10-2000; Gewijzigd om alleen de Orders te selecteren
    47.          Set rsSelect = gdbsMainDB.OpenRecordset( _
    48.                  "SELECT * FROM ProductieOrders WHERE IsOrder = True ")
    49.  
    50. [b]Pull only records that the IsOrder has been set (has been ordered?)
    51. For the beginning ID, find the first matching record.
    52. While you still have records and the beginning ID is less than the end ID
    53.   Check if there is a product order charge.
    54.      Assume true = means there is one - then set the validated field of that record
    55.     False = Delete record - no charge made...
    56. [/b]
    57.  
    58.          rsSelect.FindFirst "OpdrachtId=" & lBeginSelect
    59.          Do While (Not rsSelect.EOF) _
    60.                   And (lBeginSelect <= lEindeSelect)
    61.            'OMM 17-7-2000; Veranderd voor AS400 Koppeling
    62.            '               alleen rsSelect.Delete bestond
    63.            If CheckProductieOrderHasCharge(rsSelect![bonnummer]) Then
    64.              rsSelect.Edit
    65.              rsSelect![IsVerwijderd] = True
    66.              rsSelect.Update
    67.            Else
    68.              rsSelect.Delete
    69.            End If
    70.  
    71. [b]move to the next record, adjust begining ID
    72. [/b]
    73.            rsSelect.MoveNext
    74.            lBeginSelect = lBeginSelect + 1
    75.          Loop
    76.  
    77. [b]Possibly renumber records so they are consistant in incrementing numbers?[/b]
    78.          iSelectRegel = 1  ' New Id for the first Order
    79.          ' Eerst renumber
    80.          rsSelect.MoveFirst
    81.          Do While Not rsSelect.EOF
    82.            rsSelect.Edit
    83.            rsSelect![OpdrachtId] = iSelectRegel
    84.            rsSelect.Update
    85.            rsSelect.MoveNext
    86.            iSelectRegel = iSelectRegel + 1
    87.           Loop
    88.           rsSelect.Close
    89.           datPrimaryRs.Refresh
    90.         End If
    91.       End If
    92.     End If

    Does that help?


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  5. #5

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    yeah that does help, I know what it does now, but do you think that this is possible with ADO? 'couse there is no bookmark property for the MSHFlexgrid.


    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  6. #6
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Yup.

    Assuming you coded the filling of the flex (or if not for that matter) have a look at, um lets see if I can remember it, .RowSel or .Selected

    Otherwise look at the help for flexgrids, if you set the multi select there should be a selected collection or you loop through top to bottom looking for those rows which have been selected.


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  7. #7

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    I've tried what you've told me and this is how it looks now: I get the error 3001 which says: "The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another."


    VB Code:
    1. Case BUTTON_VERWIJDEREN
    2.     If rs.RecordCount <> 0 Then
    3.       If grdDataGrid.RowSel <= 0 Then
    4.         gsFormParm = CMD_DELRCD & "|" & rs![OpdrachtId]
    5.         frmProductieOpdrachten.Show
    6.         Me.Enabled = False
    7.       Else
    8.         If GeneralDialog(DIATYPE_OPERATORQ, Me.Caption, _
    9.                  "Weet u zeker dat u de geselecteerde productieorders wilt verwijderen?", "") = _
    10. ' this says "are you sure that you want to delete the selected orders?"
    11.                                         DIABUTTON_YES Then
    12.           ReDim arrCurrentSelection(grdDataGrid.RowSel - 1)
    13.           lNumberCurrentlySelected = grdDataGrid.RowSel
    14.           For iCnt = 0 To grdDataGrid.RowSel - 1
    15.             arrCurrentSelection(iCnt) = grdDataGrid.RowSel = (iCnt)
    16.           Next iCnt
    17.    
    18.           ' definieer hoogste en de laagste selectie plus de selectiegrootte
    19.           lBeginSelect = DEF_MAXNBR_PRODUCTIEORDERS + 1
    20.           lEindeSelect = 0
    21.           For iCnt = LBound(arrCurrentSelection) To UBound(arrCurrentSelection)
    22.           [I][B] rs.Bookmark = arrCurrentSelection(iCnt)[/B][/I] 'This is the line that the program has trouble with
    23.            If rs![OpdrachtId] < lBeginSelect Then 'lager dan de vorige waarde?
    24.              lBeginSelect = rs![OpdrachtId]
    25.            End If
    26.            If rs![OpdrachtId] > lEindeSelect Then ' hoger dan de vorige
    27.              lEindeSelect = rs![OpdrachtId]
    28.            End If
    29.          Next iCnt
    30.          'OMM 6-10-2000; Gewijzigd om alleen de Orders te selecteren
    31.          Set rsSelect = gdbsMainDB.OpenRecordset( _
    32.                  "SELECT * FROM ProductieOrders WHERE IsOrder = True ")
    33.          rsSelect.FindFirst "OpdrachtId=" & lBeginSelect
    34.          Do While (Not rsSelect.EOF) _
    35.                   And (lBeginSelect <= lEindeSelect)
    36.            'OMM 17-7-2000; Veranderd voor AS400 Koppeling
    37.            '               alleen rsSelect.Delete bestond
    38.            If CheckProductieOrderHasCharge(rsSelect![bonnummer]) Then
    39.              rsSelect.Edit
    40.              rsSelect![IsVerwijderd] = True
    41.              rsSelect.Update
    42.            Else
    43.              rsSelect.Delete
    44.            End If
    45.            rsSelect.MoveNext
    46.            lBeginSelect = lBeginSelect + 1
    47.          Loop
    48.          iSelectRegel = 1  ' New Id for the first Order
    49.          ' Eerst renumber
    50.          rsSelect.MoveFirst
    51.          Do While Not rsSelect.EOF
    52.            rsSelect.Edit
    53.            rsSelect![OpdrachtId] = iSelectRegel
    54.            rsSelect.Update
    55.            rsSelect.MoveNext
    56.            iSelectRegel = iSelectRegel + 1
    57.           Loop
    58.           rsSelect.Close
    59.           rs.Update
    60.         End If
    61.       End If
    62.     End If
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  8. #8
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Redimming until the last selected row ? Does this work if the last row is at the top?
    Also what is the type of array? Boolean?
    Was there a collection of selected rows on the HFlexgrid?
    The bit below in italic is probably wrong
    and if it does what I am guessing its setting the array to
    0 (false) or -1 (true) and you can't have a negative bookmark...
    Try taking out the '='

    Originally posted by WiseGuy
    VB Code:
    1. ReDim arrCurrentSelection(grdDataGrid.RowSel - 1)
    2.           lNumberCurrentlySelected = grdDataGrid.RowSel
    3.           For iCnt = 0 To grdDataGrid.RowSel - 1
    4.             arrCurrentSelection(iCnt) = [i]grdDataGrid.RowSel = (iCnt)[/i]
    5.           Next iCnt

    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  9. #9

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Well, if I take out the '=' than I get an compilation error which says 'Wrong number of arguments or invalid property assignment'.

    The arrCurrentSelection is a Variant (whatever that is) and
    lNumberCurrentlySelected is Long


    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  10. #10
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Hi,

    Ok asuming the first column holds the Records ID, you need to store this into the array.

    Variant - means it can be any type and won't error... so could be a string or a number, or an object, etc. Uses more memory though because the program doesn't know what type to expect.

    What you are trying to do is flag all the records in the table that have been selected. Then see if they have charge records.

    One way is to create a flag field, use an executeable query to set it to false. Then for those selected set that field to true. Then perform the charge checks, flagging into the field appropriate (the approved field?). the execute a query to delete all those flagged in the first field mentioned that don't have the approved field set to true.

    The other is the way its coded so far. There are again several approaches.
    If there is no collection of selected (which would only hold those rows of the flexgrid that have been selected) then you need to loop through all entries of the flexgrid...
    VB Code:
    1. Dim lngLoop as long, lngMaxReturned as long
    2. Dim aryIDs() as long
    3.  
    4. lngMaxReturned=0
    5.  
    6. '---- loop through all rows in the flex grid and save to the array
    7. '---- only those we want (the selectedones)
    8. For lngLoop = 0 to flexgrid.rows-1
    9.   If flexgrid.rowsel(lngloop) then
    10.     Redim Preserve aryIDs(lngMaxreturned)
    11.     aryIDs(lngMaxReturned)=CLng(flexgrid.textmatrix(lngLoop,0))
    12.     lngMaxReturned=lngMaxReturned+1
    13.   End if
    14. Next
    This assumes that it is Long type ids being returned and are held in the first column (0) which is probably invisible...

    The preserve SHOULD preserve the existing array elements and since you are only adding won't affect them

    Lemme know ok?


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  11. #11

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Originally posted by Ecniv
    VB Code:
    1. Dim lngLoop as long, lngMaxReturned as long
    2. Dim aryIDs() as long
    3.  
    4. lngMaxReturned=0
    5.  
    6. '---- loop through all rows in the flex grid and save to the array
    7. '---- only those we want (the selectedones)
    8. For lngLoop = 0 to flexgrid.rows-1
    9.   If flexgrid.rowsel(lngloop) then
    10. 'for some reason this doesn't work I get the same error I got before: 'Wrong number of arguments or invalid property assignment'
    11.     Redim Preserve aryIDs(lngMaxreturned)
    12.     aryIDs(lngMaxReturned)=CLng(flexgrid.textmatrix(lngLoop,0))
    13.     lngMaxReturned=lngMaxReturned+1
    14.   End if
    15. Next

    Vince

    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  12. #12
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    hmmmm

    Ok two things..
    1) put the editting cursor over rowsel and hit f1.... that should tell you the parameters
    2) change rowsel to selected or selection again hit f1 and see what the help says.

    It might be selected, in which case it'll work ok


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  13. #13

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Okey, I got a little further again
    But now I hang on this line:

    rs.Bookmark = arrCurrentSelection(iCnt)

    I don't even know what it does.

    I'm sorry I'm such a slow learning person but normally I'm not a programmer. I've been using VB for a month now! without any books


    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  14. #14
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    (1)
    lBeginSelect = DEF_MAXNBR_PRODUCTIEORDERS + 1
    lEindeSelect = 0
    For iCnt = LBound(arrCurrentSelection) To UBound(arrCurrentSelection)
    rs.Bookmark = arrCurrentSelection(iCnt) 'This is the line that the program has trouble with
    If rs![OpdrachtId] < lBeginSelect Then 'lager dan de vorige waarde?
    lBeginSelect = rs![OpdrachtId]
    End If
    If rs![OpdrachtId] > lEindeSelect Then ' hoger dan de vorige
    lEindeSelect = rs![OpdrachtId]
    End If
    Ok so you are here. Again (see three or four posts before ) But the difference is you have an array of IDs which were selected. Correct ?

    If you have a little time spare and several (appropriated) sheets of a4 paper (from the printer ) I'd flow chart what the progarm is meant to do. Then you know how to change it

    The code quoted above appears to reset the beginning and end IDs if the current records (the one you moved to on the bookmark) ID is smaller or larger respectively.

    Since your array has the IDs in question (all the selected ones) You could mimic the above code by loopign through your array and comparing the beginning and end numbers and change them as appropriate.

    However, perhaps looking at why the original programmer was moving the end and beginning ids...
    (2)
    Set rsSelect = gdbsMainDB.OpenRecordset( _
    "SELECT * FROM ProductieOrders WHERE IsOrder = True ")
    rsSelect.FindFirst "OpdrachtId=" & lBeginSelect
    Do While (Not rsSelect.EOF) _
    And (lBeginSelect <= lEindeSelect)
    'OMM 17-7-2000; Veranderd voor AS400 Koppeling
    ' alleen rsSelect.Delete bestond
    If CheckProductieOrderHasCharge(rsSelect![bonnummer]) Then
    rsSelect.Edit
    rsSelect![IsVerwijderd] = True
    rsSelect.Update
    Else
    rsSelect.Delete
    End If
    rsSelect.MoveNext
    lBeginSelect = lBeginSelect + 1
    Loop
    This is the next section. Here you open the records and find the first ID (beginning value) then keep looping until the beginning value is greater than or equal to the end value.

    Why bother with the top bit (1) though ? You don't need it so get rid of it. All you need to do is find each one of the selected (held in the array) and check that they can either be deleted or have a field set to true - (2) -

    What the programmer has assumed is that the flexgrid will be populated IN ORDER by the ID. So your array should hold all the IDs in ascending order. If this is the case, then you need to change (2) to something like the following :
    VB Code:
    1. Set rsSelect = gdbsMainDB.OpenRecordset( _
    2.                  "SELECT * FROM ProductieOrders WHERE IsOrder = True ")
    3.          For lngLoop = 0 to lngMaxReturned-1
    4.            rsSelect.FindFirst "OpdrachtId=" & aryIDs(lngLoop)
    5.            'OMM 17-7-2000; Veranderd voor AS400 Koppeling
    6.            '               alleen rsSelect.Delete bestond
    7.            If CheckProductieOrderHasCharge(rsSelect![bonnummer]) Then
    8.              rsSelect.Edit
    9.              rsSelect![IsVerwijderd] = True
    10.              rsSelect.Update
    11.            Else
    12.              rsSelect.Delete
    13.            End If
    14.          Next
    And remember I don't like using this method - but if it works use it until your coding style changes
    Note: This assumes that there are records there to find, if you are in a multi user there is a chance they could be deleted...


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  15. #15

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Hi there,

    it took me quite a long while before I understood what you wrote.
    And I still don't get it all.

    I've made the adjustments you said I should. But it still doesn't work. I still get the error in the first part.
    Maybe I should completely understand the code first and see what it does but I don't have the experience to do that. It would take me weeks to find that out.

    But it's propably just an syntax error If you could just tell me excactly what these lines do:

    VB Code:
    1. For iCnt = LBound(arrCurrentSelection) To UBound(arrCurrentSelection)
    2.            rs.Bookmark = arrCurrentSelection(iCnt) '<----- ERROR!!
    3.            If rs!OpdrachtId < lBeginSelect Then
    4.              lBeginSelect = rs![OpdrachtId]
    5.            End If


    Or maybe you know what the correct syntax is?
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  16. #16

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Originally posted by Ecniv
    If you have a little time spare and several (appropriated) sheets of a4 paper (from the printer )
    I'd flow chart what the progarm is meant to do. Then you know how to change it

    Vince

    This would propably be 'mission impossible' for me, this program fas 48 forms and 16 Modules!!

    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  17. #17
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Hi,

    Lets see if I can make it clearer (or muddy the water)
    Flowchart - well no need to do the whole project, just the parts that interact with this particular problem

    The delete button does the following (Currently):
    • Checks the bookmarks (all those selected) If the count is 0 then, creates the parameters, it opens the next form
      Otherwise
    • Ask a question, if the answer is Yes, then create an array of all the IDs selected (via bookmarks)
    • It then finds out each of the selected IDs and compares them against the start loop number (Beginning) and end number ID - If they are different, change them so the selected IDs are all included
    • Now starting at the Beginning number, loop through the records and check whether the Order charge has been applied. If it has, set a field to true...If not then delete
    • Increment the Beginning number and repeat above until either there are no records (EOF) or the beginning is greater than or equal to the end number.
    • All existing records are then renumbered back into order.


    Unfortunately whoever did this didn't account for the program checking ALL IDs between the highest and lowest, even if they weren't selected.

    So, you change it to ADO. You FORGET bookmarks, because as you stated, they aren't used in ADO.

    Now, I've simplified the process (above), so now we need to change it to allow you to use a flexgrid.
    I assume you are filling the flexgrid via code and using Order By the ID field.

    • Loop through ALL rows and find out which are selected. Store the ID numbers into an array
    • Using this array, we open the recordset (again in order) and move to the ID in the first entry of the array
    • Then check whether there is a charge - if there is -> update the validated field - - - If not -> Delete
    • Once the For...Next loop has completed, you will need to refresh/requery the flexgrid...

    Set rsSelect = gdbsMainDB.OpenRecordset("SELECT * FROM ProductieOrders WHERE IsOrder = True ")
    For lngLoop = 0 to lngMaxReturned-1
    rsSelect.FindFirst "OpdrachtId=" & aryIDs(lngLoop)
    'OMM 17-7-2000; Veranderd voor AS400 Koppeling
    ' alleen rsSelect.Delete bestond
    If CheckProductieOrderHasCharge(rsSelect![bonnummer]) Then
    rsSelect.Edit
    rsSelect("IsVerwijderd") = True
    rsSelect.Update
    Else
    rsSelect.Delete
    End If
    Next
    Hope that helps - if not lemme know.


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  18. #18

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Hmm still can't get it to work. Maybe I should completely rewrite the code, but the problem is that I'm not experienced enough.
    An other option for me is to do it in small steps so first step is to delete just one record. Could you help me with that?


    WiseGuy

    P.S. here's what I have now, it runs without errors but nothing is deleted:

    VB Code:
    1. If rs.RecordCount <> 0 Then
    2.       If grdDatagrid.RowSel <= 0 Then
    3.         gsFormParm = CMD_DELRCD & "|" & rs![OpdrachtId]
    4.         frmProductieOpdrachten.Show
    5.         Me.Enabled = False
    6.       Else
    7.         If GeneralDialog(DIATYPE_OPERATORQ, Me.Caption, _
    8.                  "Weet u zeker dat u de geselecteerde productieorders wilt verwijderen?", "") = _
    9.                                         DIABUTTON_YES Then
    10.           'ReDim arrCurrentSelection(grdDatagrid.RowSel - 1)
    11.           'lNumberCurrentlySelected = grdDatagrid.RowSel
    12.           'For iCnt = 0 To grdDatagrid.RowSel - 1
    13.           '  arrCurrentSelection(iCnt) = grdDatagrid.RowSel
    14.           'Next iCnt
    15.              ' definieer hoogste en de laagste selectie plus de selectiegrootte
    16.           lBeginSelect = DEF_MAXNBR_PRODUCTIEORDERS + 1
    17.           lEindeSelect = 0
    18.          ' For iCnt = LBound(arrCurrentSelection) To UBound(arrCurrentSelection)
    19.          '  rs.Bookmark = arrCurrentSelection(iCnt)
    20.          '  If rs!OpdrachtId < lBeginSelect Then 'lager dan de vorige waarde?
    21.          '    lBeginSelect = rs![OpdrachtId]
    22.          '  End If
    23.          '  If rs![OpdrachtId] > lEindeSelect Then ' hoger dan de vorige
    24.          '    lEindeSelect = rs![OpdrachtId]
    25.          '  End If
    26.          'Next iCnt
    27.          'OMM 6-10-2000; Gewijzigd om alleen de Orders te selecteren
    28.           For lngLoop = 0 To lngMaxReturned - 1
    29.          rsSelect.Find "OpdrachtId=" & aryIDs(lngLoop)
    30.           ' If CheckProductieOrderHasCharge(rsSelect![bonnummer]) Then
    31.           '   rsSelect.Update
    32.           '   rsSelect!IsVerwijderd = 1
    33.           '   rsSelect.Update
    34.           ' Else
    35.              rsSelect.Delete
    36.           ' End If
    37.          Next
    38.          iSelectRegel = 1  ' New Id for the first Order
    39.          ' Eerst renumber
    40.          'rsSelect.MoveFirst
    41.          Do While Not rsSelect.EOF
    42.            rsSelect.Update
    43.            rsSelect![OpdrachtId] = iSelectRegel
    44.            rsSelect.Update
    45.            rsSelect.MoveNext
    46.            iSelectRegel = iSelectRegel + 1
    47.           Loop
    48.           rsSelect.Close
    49.           'rs.Update
    50.         End If
    51.       End If
    52.     End If

    B.T.W. here's another thing I don't understand:

    ' If rs!OpdrachtId < lBeginSelect Then
    ' lBeginSelect = rs![OpdrachtId]
    ' End If
    ' If rs![OpdrachtId] > lEindeSelect Then
    ' lEindeSelect = rs![OpdrachtId]
    ' End If

    I can't figure out where lBeginSelect and lEindeSelect is filled. asside from:
    lBeginSelect = DEF_MAXNBR_PRODUCTIEORDERS + 1
    lEindeSelect = 0


    I'm sorry if I'm such a pain in the ass and I want you to know that I appreciate it very much that you are trying to help me out!

    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  19. #19
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Originally posted by WiseGuy
    VB Code:
    1. [b]Use EOF not record count[/b]
    2. If not rs.EOF Then
    3.  
    4. [b]1) You need to have a count of how many have been
    5. selected... I can't remember if there is selcount..?[/b]
    6.       If grdDatagrid.RowSel <= 0 Then
    7.         gsFormParm = CMD_DELRCD & "|" & rs![OpdrachtId]
    8.         frmProductieOpdrachten.Show
    9.         Me.Enabled = False
    10.       Else
    11.         If GeneralDialog(DIATYPE_OPERATORQ, Me.Caption, _
    12.                  "Weet u zeker dat u de geselecteerde productieorders wilt verwijderen?", "") = _
    13.                                         DIABUTTON_YES Then
    14.           'ReDim arrCurrentSelection(grdDatagrid.RowSel - 1)
    15.           'lNumberCurrentlySelected = grdDatagrid.RowSel
    16.           'For iCnt = 0 To grdDatagrid.RowSel - 1
    17.           '  arrCurrentSelection(iCnt) = grdDatagrid.RowSel
    18.           'Next iCnt
    19.              ' definieer hoogste en de laagste selectie plus de selectiegrootte
    20.  
    21. [b]2) See below[/b]
    22.           lBeginSelect = DEF_MAXNBR_PRODUCTIEORDERS + 1
    23.           lEindeSelect = 0
    24.          ' For iCnt = LBound(arrCurrentSelection) To UBound(arrCurrentSelection)
    25.          '  rs.Bookmark = arrCurrentSelection(iCnt)
    26.          '  If rs!OpdrachtId < lBeginSelect Then 'lager dan de vorige waarde?
    27.          '    lBeginSelect = rs![OpdrachtId]
    28.          '  End If
    29.          '  If rs![OpdrachtId] > lEindeSelect Then ' hoger dan de vorige
    30.          '    lEindeSelect = rs![OpdrachtId]
    31.          '  End If
    32.          'Next iCnt
    33.  
    34.  
    35.          'OMM 6-10-2000; Gewijzigd om alleen de Orders te selecteren
    36. [b]
    37. 3) What does CheckProductieOrderHasCharge do?
    38. I should just check using the ID to another linked table
    39. (my guess) which could actuall be done here using a left join
    40. - possibly...
    41. Also need a check that the ID has been found...
    42. [/b]
    43.           For lngLoop = 0 To lngMaxReturned - 1
    44.          rsSelect.Find "OpdrachtId=" & aryIDs(lngLoop)
    45.            If CheckProductieOrderHasCharge(rsSelect("bonnummer")) Then
    46.              rsSelect.Update
    47.              rsSelect!IsVerwijderd = 1
    48.              rsSelect.Update
    49.            Else
    50.              rsSelect.Delete
    51.            End If
    52.          Next
    53.  
    54. [b]4) Renumbers Ids[/b]
    55.          iSelectRegel = 1  ' New Id for the first Order
    56.          ' Eerst renumber
    57.          rsSelect.MoveFirst
    58.          Do While Not rsSelect.EOF
    59.            rsSelect.Update
    60.            rsSelect![OpdrachtId] = iSelectRegel
    61.            rsSelect.Update
    62.            rsSelect.MoveNext
    63.            iSelectRegel = iSelectRegel + 1
    64.           Loop
    65.           rsSelect.Close
    66.         End If
    67.       End If
    68.     End If

    B.T.W. here's another thing I don't understand:

    All this does is set the beginning pointer to the end and the
    end pointer to the beginning. Then as you loop through it moves
    the beginning pointer to the smallest ID and the End poitner to
    the largest ID. As I pointed out in my previous post, this is a bad
    way of doing it as it does ALL the IDs between the beginning and
    end ids, not just those selected...


    I can't figure out where lBeginSelect and lEindeSelect is filled. asside from:
    lBeginSelect = DEF_MAXNBR_PRODUCTIEORDERS + 1
    lEindeSelect = 0

    ' If rs!OpdrachtId < lBeginSelect Then
    ' lBeginSelect = rs![OpdrachtId]
    ' End If
    ' If rs![OpdrachtId] > lEindeSelect Then
    ' lEindeSelect = rs![OpdrachtId]
    ' End If


    I'm sorry if I'm such a pain in the ass and I want you to know that I appreciate it very much that you are trying to help me out!

    Me? Or the previous coder hehhehehe
    I bet you don't wanna meet them now
    If you understand what its doing it would probably be best if you rewrote in your own code, as you'd know what its doing.


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  20. #20

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Grrrr still doesn't work (not mad at you )

    Here's the code I have now. I've checked but there is no such thing as selcount.
    But even if there was where excactly should I put or replace it?
    Oh and about the left Join, I believe that's Acces but this program
    needs to chat with an Oracle DB

    VB Code:
    1. If Not rs.EOF Then
    2.         gsFormParm = CMD_DELRCD & "|" & rs![OpdrachtId]
    3.         frmProductieOpdrachten.Show
    4.         Me.Enabled = False
    5.       Else
    6.        If GeneralDialog(DIATYPE_OPERATORQ, Me.Caption, _
    7.                  "Weet u zeker dat u de geselecteerde productieorders wilt verwijderen?", "") = _
    8.                                         DIABUTTON_YES Then
    9.           ReDim arrCurrentSelection(grdDatagrid.RowSel - 1)
    10.           lNumberCurrentlySelected = grdDatagrid.RowSel
    11.           For iCnt = 0 To grdDatagrid.RowSel - 1
    12.             arrCurrentSelection(iCnt) = grdDatagrid.RowSel
    13.           Next iCnt
    14.           lBeginSelect = DEF_MAXNBR_PRODUCTIEORDERS + 1
    15.           lEindeSelect = 0
    16.           For lngLoop = 0 To lngMaxReturned - 1
    17.          rsSelect.Find "OpdrachtId=" & aryIDs(lngLoop)
    18.            If CheckProductieOrderHasCharge(rsSelect("bonnummer")) Then
    19.              rsSelect.Update
    20.              rsSelect!IsVerwijderd = 1
    21.              rsSelect.Update
    22.            Else
    23.              rsSelect.Delete
    24.            End If
    25.          Next
    26.          iSelectRegel = 1
    27.          rsSelect.MoveFirst
    28.          Do While Not rsSelect.EOF
    29.            rsSelect.Update
    30.            rsSelect!OpdrachtId = iSelectRegel
    31.            rsSelect.Update
    32.            rsSelect.MoveNext
    33.            iSelectRegel = iSelectRegel + 1
    34.           Loop
    35.           rsSelect.Close
    36.         End If
    37.       End If

    Right now it keeps on hanging on the rsSelect.movenext line

    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  21. #21
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    So the records were updated correctly before that?
    Any error message or just stops working?


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  22. #22
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    VB Code:
    1. lNumberCurrentlySelected = 0
    2.           For iCnt = 0 To grdDatagrid.Rows - 1
    3.              If grdDataGrid.RowSel(iCnt) then
    4.                 arrCurrentSelection(INumberCurrentlySelected) = grdDatagrid.textmatrix(iCnt,0)
    5.                 INumberCurrentlySelected=INumberCurrentlySelected + 1
    6.               End If
    7.           Next iCnt

    In response to the count bit

    I suggest that you use the remarks in your coding (with the single quote) and break it up into sections so if you need to look at it again in the future you'll know what you did


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  23. #23

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Could this line:
    If grdDataGrid.RowSel(iCnt) then

    also be done like this:
    If grdDataGrid.RowSel = (iCnt) Then

    or is that something completely different? When I use the first line it gives the error "Wrong number of arguments or invalid property assignment"

    And when I use the second line it gives an error on the line:
    rsSelect.MoveFirst
    wich says: "Method 'MoveFirst of object'_Recordset' failed"

    Any Ideas?
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  24. #24
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Hmm microsoft site doesn't seem to be working from here and I don't have vb to hand...


    What does the help say about RowSel ?


    Stoopid network here at work...

    I don't remember there being a Selected property, otherwise I would say it was something like : Flex.Row(iCnt).Selected


    If MS gets up I'll browse the msdn libs and let you know ok..


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  25. #25

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Here's what Help has to say about RowSel

    Syntax

    object.ColSel [= value]
    object.RowSel [= value]

    Syntax for the ColSel and RowSel properties has these parts:

    Part Description
    object Anobject expression that evaluates to an object in the Applies To list.
    value ALong value that specifies the start or end row, or column, for a range of cells.


    Remarks

    You can use these properties to select a specific region of the MSHFlexGrid programmatically, or to read the dimensions of an area that the user selects into code.

    The MSHFlexGrid cursor is in the cell at Row, Col. The MSHFlexGrid selection is the region between rows Row and RowSel and columns Col and ColSel. Note that RowSel may be above or below Row, and ColSel may be to the left or to the right of Col.

    Whenever you set the Row and Col properties, RowSel and ColSel are automatically reset, so the cursor becomes the current selection. To select a block of cells from code, you must first set the Row and Col properties, and then set RowSel and ColSel.
    I don't remember there being a Selected property, otherwise I would say it was something like : Flex.Row(iCnt).Selected
    He recognizes it but doesn't work, I get the same error:
    "Wrong number of arguments or invalid property assignment"

    What's the addres of the MS MSDN librarys, I could take a peek myself sometimes


    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  26. #26
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    M S D N - a search

    Basically, www.microsoft.com then use the search... putting msdn as the first search parameter

    I have thought of another way around, but you might not like it...
    It uses and array of boolean, one for each row. As the user clicks the array is updated (either all to true ot flips the boolean). Then when you need to find all the selected rows you go through the array. Just a thought, back up plan just incase


    Vince
    Still wading through MSDN online....

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  27. #27

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    I don't have any problems getting on the MSDN libs.....

    About the workaround................................................. I'll have to think about that

    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  28. #28
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Have a look and see if there is a property called - ItemsSelected

    If there is everything is solved... but seeing as that would be easy there probably isn't

    MSDN Helpfiles on MSHFlexgrid



    Vince
    Last edited by Ecniv; May 13th, 2002 at 05:29 AM.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  29. #29

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Originally posted by Ecniv
    Have a look and see if there is a property called - ItemsSelected

    I assume you meant a property of the MSHFlexGrid? Then no there isn't, If you meant something else lemmeno

    If there is everything is solved... but seeing as that would be easy there probably isn't


    It's allways like that right? sigh........


    Vince
    WiseGuy
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

  30. #30

    Thread Starter
    Lively Member WiseGuy's Avatar
    Join Date
    Apr 2002
    Location
    Zierikzee, The Netherlands
    Posts
    98
    Well still can't get it to work properly, I think I'll start working on the backup plan you suggested :

    I have thought of another way around, but you might not like it...
    It uses and array of boolean, one for each row. As the user clicks the array is updated (either all to true ot flips the boolean). Then when you need to find all the selected rows you go through the array. Just a thought, back up plan just incase
    WiseGuy

    P.S. thank you very much for trying to help me
    I stuck my head out of the window and got arrested for mooning!

    This Post is sponsored by my PC: PIII900, 512MBDimm/133, Seagate 40GB/7200 ATA100, LiteOn 12x DVD, Lite-On 32x12x40 CDrw, Elsa Geforce2 Ultra 64MB incl tv-out, SoundBlaster Live 1024, Ilyama A702HT Vision Master Pro410 17".
    O/S: Windows XP Professional (dutch)
    Internet: Cable (1Mbit connection)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width