Results 1 to 7 of 7
  1. #1
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528

    lines of code


    There is no way to shorten the book in these lines of code ?
    Code:
    C1 = [Forms]![TStu2SBehTeam]![C1] 
    C2 = [Forms]![TStu2SBehTeam]![C2] 
    C3 = [Forms]![TStu2SBehTeam]![C3] 
    C4 = [Forms]![TStu2SBehTeam]![C4] 
    C5 = [Forms]![TStu2SBehTeam]![C5]

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664

  3. #3
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528
    Thanks Steve
    Is it becomes something like this?
    Dim i As Integer

    For i = C1 To C5

    Me("TStu2SBehTeam" & i).Value

    Next i

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    C1 = [Forms]![TStu2SBehTeam]![C1]
    What is the "C1" in red? Is it a control on a form? Or a variable in code?

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    For i = 1 to 5

    However, the code in the loop is only half an expression. What do you want to do with the value?

    And as ssanfu asked, what are C1, etc?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    528
    Thanks Steve and June

    C1 is (Checkbox) exists on the report
    Take the value of the a form
    Click image for larger version. 

Name:	33.PNG 
Views:	16 
Size:	3.3 KB 
ID:	18196

  7. #7
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Code:
    for i = 1 to 27
    
    Me("TStu2SBehTeam" & i).Value = true    'or some value
    
    next

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Print lines on Access
    By luckasx in forum Access
    Replies: 9
    Last Post: 11-21-2013, 06:37 PM
  2. Replies: 2
    Last Post: 10-10-2013, 02:27 PM
  3. lines on forms
    By Don Webb in forum Forms
    Replies: 2
    Last Post: 11-07-2011, 08:45 PM
  4. Column Lines
    By Alex Motilal in forum Programming
    Replies: 2
    Last Post: 10-26-2011, 06:04 AM
  5. Curved Lines
    By Rawb in forum Reports
    Replies: 3
    Last Post: 10-24-2011, 07:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums