Results 1 to 8 of 8

Thread: For Each Statement - Need Help! {Resolved}

Threaded View

  1. #1

    Thread Starter
    Addicted Member epod69's Avatar
    Join Date
    Feb 2005
    Location
    Cambridge, WI - USA
    Posts
    239

    Resolved For Each Statement - Need Help! {Resolved}

    Hi everyone, I have a picturebox (called GridFrame) which can have any amount of checkboxes in it. During a Sub I am wanting to check each checkbox in Gridframe and see if they are check, and if so, add text to a cell.

    Here is what I want to do:
    VB Code:
    1. For Each CheckBox In GridFrame
    2.             If CheckBox.Value = True Then
    3.                 CellText = DetailsGrid.CellText((lRow - 2), 5)
    4.                 If CellText = "" Then
    5.                     CellText = CheckBox.Caption
    6.                 Else
    7.                     CellText = CellText & "; " & CheckBox.Caption
    8.                 End If
    9.             End If
    10.         Next CheckBox
    Of course this doesnt work and I get a Variable not defined error which points to CheckBox. So, if you can understand what I am trying to do, then what suggestions might anyone have on what I should do or a correct way of how I should do it using the For Each Statement. Thanx everyone for the help! =)
    Last edited by epod69; May 26th, 2005 at 02:26 PM.

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