Results 1 to 5 of 5
  1. #1
    mahmud1180 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    20

    Access form text box name property with a bracket

    Hey, Is there any way to name the text box like "Contract (1)" I can write it this way but it is recognized as Me.Contract_1_. I need to name it Contract(1) as I have to run some iteration in VBA. Any idea?




    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    There is no need to use parens in a text box name. Names are not critical to users, make the names without special characters.
    The only one that cares about the exact name is the Access program. Users can look at the caption. The dont know what the box name is.
    Rename the text box to Contract, or txtContract.

  3. #3
    mahmud1180 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    20
    Thank you ranman for your reply. I used the parenthesis to link it to run a for loop in vba. Like:

    For i= 1 to 5
    If Contract (i) = 1 Then


    D(i) = y.Range("A" & i).Value


    End If

    Next i

    I think in VBA this is the right way to store data in each loop.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    Also possible without parens:

    for each ctl in controls
    if ctl.type = "TextBox" then ctl = range.value
    next

  5. #5
    mahmud1180 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2014
    Posts
    20
    I dont think this will serve my purpose. So, there is no way I can name it with a parenthesis?

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

Similar Threads

  1. Dirty property for Text Box
    By tylerg11 in forum Forms
    Replies: 6
    Last Post: 04-07-2015, 11:02 AM
  2. Replies: 5
    Last Post: 06-23-2012, 04:30 PM
  3. Replies: 3
    Last Post: 01-04-2012, 05:16 PM
  4. Intriguing Access 2003 Bracket problem
    By pinecrest515 in forum Access
    Replies: 1
    Last Post: 02-22-2011, 04:35 PM
  5. Access 2003, sort order property of a form
    By Rick West in forum Forms
    Replies: 11
    Last Post: 09-17-2009, 08:28 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
  •  
Other Forums: Microsoft Office Forums