Results 1 to 4 of 4
  1. #1
    dgj32784 is offline Novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    22

    Subform Name in VBA Variable Definition Keeps Changing to Lower Case

    This is really weird and I'm not sure what is going on. I have some VBA to check the values of two combo boxes on my forms against one another. I first define two variables to be the values in the combo boxes. I have this running on many forms but for some reason when I tried to replicate the functionality in another form, it keeps changing the text characters in the name of my subform to lowercase.

    This is what it should be:

    cbo1 = Forms.frmBMPQREHABCA.frmBMPQREHABCAsubform.Form.cb oBMPImp

    But when I updated the VBA to be the name of the new form/subform, it kept changing the text after I typed to be the following:

    cbo1 = Forms.frmBMPQREHABCA.frmBMPQrehabcasubform.Form.cb oBMPImp



    The problem of course is that there is no form named "BMPQrehabcasubform" so when I click my command button that checks the values in the combo boxes I get an error.

    Anyone know what in the world is going on? I've compacted and repaired to no avail.

    Thanks,
    David

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Access is case insensitive AFAIK. I haven't seen syntax like what you have.

    Maybe this will help:
    Refer to Form and Subform properties and controls
    http://access.mvps.org/access/forms/frm0031.htm

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You have the subform container control named the same as the form in the SourceObject property? I always name subform container control different from the object it holds, like ctrBMP or subBMP.

    Somewhere, Access is finding the lower case version and using it. I have seen this with fieldnames and controlnames and it doesn't affect code performance so I just ignore.
    Last edited by June7; 08-21-2012 at 05:15 PM.
    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.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    What they said! To the Access Gnomes

    frmBMPQREHABCAsubform

    and

    frmBMPQrehabcasubform

    are the same, identical thing! You need to look for another culprit, here! And unless the bit in Red

    cbo1 = Forms.frmBMPQREHABCA.frmBMPQrehabcasubform.Form.cb oBMPImp

    is a typo, that Space between cb and oBMPImp, which I assume is supposed to be cboBMPImp, could be it!

    Also, the behavior you noted, of changing cases in names, does occur when you change it, somewhere. How it's formatted is dependent on its formatting the last time you typed it somewhere! Simply re-type it, as you want it, anywhere in a Code Module, and all instances will be converted to that formatting.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Changing records on Main and Subform
    By steve9495 in forum Forms
    Replies: 10
    Last Post: 07-14-2012, 01:46 PM
  2. Replies: 8
    Last Post: 03-16-2012, 11:04 AM
  3. Replies: 4
    Last Post: 05-16-2011, 04:58 PM
  4. Upper & Lower Case in table
    By Forums10 in forum Access
    Replies: 4
    Last Post: 01-31-2011, 09:01 AM
  5. Converting all text input to lower case
    By aommaster in forum Forms
    Replies: 6
    Last Post: 08-05-2009, 05:43 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