Results 1 to 4 of 4
  1. #1
    skydivetom is online now VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046

    Change of fieldname results in VBA error

    Experts:


    I need some help with identifying an error (in VBA) which is due based on **changing a fieldname**.




    Attached are the following documents:
    - Database "Version01" -- this version works w/o issues (before change of fieldname)
    - Database "Version02" -- this is a replica of v01 but w/ the updated fieldname... resulting in a VBA error
    - PDF "Summary" -- this document includes some screenshots and highlights the differences between v01 and v02


    As indicated in the PDF, I simply changed the fieldname in table "T00_JunctionTable_CPR" + 3 instances in the VBA (of subform).
    Unfortunately (see illustration in the PDF) v02 results in a VBA error. Does anyone know where/what else needs to be updated so that v02 works just like v01?


    Thank you,
    EEH
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    My question is "Why does Ver 1 work?" Note that in Ver 1 a reference of Me.RoleIDfk will fail. I have no idea how Ver 1 is finding Me.StaffMemberIDfk and listing it in intellisense even though it does not show in form Properties Sheet list. There is no control with this name just as there is no control named RoleIDfk.

    However, use of ! does work in Ver 2: Me!ContactIDfk




    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.

  3. #3
    skydivetom is online now VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    June7 -- THOUSAND THANKS!!!
    I would have never thought to change the "." with an "!". You're absolutely right... why would it work in v01 but not in v02. Anyhow, you solved the mystery!
    Thank you again,
    Tom

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Code should reference control name, not the field: Me.cbo_LastName
    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.

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

Similar Threads

  1. Modifying fieldname results in VBA error
    By skydivetom in forum Programming
    Replies: 2
    Last Post: 07-24-2019, 05:01 AM
  2. Replies: 1
    Last Post: 05-03-2018, 12:38 PM
  3. Replies: 4
    Last Post: 02-07-2018, 02:57 PM
  4. Replies: 6
    Last Post: 08-28-2014, 12:33 PM
  5. Replies: 14
    Last Post: 11-16-2010, 03:56 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