Results 1 to 5 of 5
  1. #1
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544

    Question Form Name Problem

    I have a form named "frmNon-Corpofferinformation". However, every time I try to reference it in VBA it automatically changes the name to "frmNon - Corpofferinformation" (Note the spaces in between "frmNon - Corp...". When it does this it is treating "FrmNon" as a variable and telling me I don't have the variable defined. I am trying to obtain a value within that form and need to reference the form. This is the code I want to use:



    Code:
    varDenFrameValue = form_frmNon-Corpofferinformation.frameDenialOptions.Value

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    The inadvisable symbol in the name will always cause problems. I'd change it if it's not too late. If it is, try:

    varDenFrameValue = Forms![frmNon-Corpofferinformation].frameDenialOptions.Value
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    Unfortunately I was not the original developer and it would take way too much time to change everything. Thank you for the help.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    No problem. I understand about being too far down the road to change the name. Get friendly with those brackets; you're going to need them!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    Thanks again! Will do!

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

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2010, 03:25 PM
  2. Problem with main form
    By lukusm in forum Forms
    Replies: 1
    Last Post: 01-18-2010, 02:41 AM
  3. Print Form problem
    By Stelios Panayides in forum Forms
    Replies: 1
    Last Post: 10-06-2009, 07:06 AM
  4. Form Data problem
    By rjjhome in forum Forms
    Replies: 7
    Last Post: 05-29-2009, 11:51 AM
  5. Form Input Problem
    By alvin in forum Forms
    Replies: 2
    Last Post: 01-12-2006, 09:42 PM

Tags for this Thread

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