Results 1 to 7 of 7
  1. #1
    jake7363 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2016
    Posts
    13

    Access 365 changing case of field/fieldname

    Hello,



    There is probably a simple answer to this that I am overlooking, but I have a strange issue occurring. I have two separate tables in a database for which I am using "DOCNO" as an autonumber, key field in each; however, the tables do have two unique data sets.

    In Table 1, I am using Conditional formatting to a) color highlight the current row and b) highlight the current field in that row with a different color. It works perfectly.

    In Table 2, I followed the exact same process (for which I wrote down the process to ensure I followed it correctly), checked the settings multiple times (including for any typos) and Access changed the Field from "DOCNO" to "Docno". The expression in the Conditional Formatting refers to a hidden textbox called selDOCNO.
    The expression reads:
    selDOCNO = DOCNO.

    In Form_Current, the same expression exists:
    Form_Current
    selDOCNO = DOCNO.


    The only thing I can think of is the possibility that the same Field Name (not control name) is confusing the issue, being in the same database. Is that illogical? If so, is there another answer?

    *Note: I am a slight bit past Novice, please be kind. 8~/)

    Cheers

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Access is not case sensitive.
    No idea as to why, but I would not be too concerned.
    Is there a setting in 365 that makes ProperCase for variables/controls?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Because access is not case sensitive, sometimes if you change the case of an object name having already referenced to it, it retains the original case. Usually compact/repair or copying everything to a new db will solve the issue.

    I would argue that field names should be unique to the application, not just the table. Although DocID is not as meaningless as ID, in the context of your application it would appear it is

  4. #4
    jake7363 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2016
    Posts
    13
    I guess the only option, then, is to delete one of the primary keys and start from scratch.

    I am going to leave this post open until I can test out the revised form is finished in case there might be another issue.

    Thanks for the input.


    Best Regards,
    Jake

  5. #5
    jake7363 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2016
    Posts
    13
    Back again. The problem I originally reported was based on an assumption that I made in order to avoid the potential lack of clarity in my explanation of the ultimate problem. Now, I made the change to the second Primary Key and the case is consistent.

    The reasoning I had was that the problem of the case-change caused the main issue of the selected row color not displaying. Since I have verified that the Conditional Formatting is correct, are there any suggestions for the selected row not showing the color?

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    You need to use square brackets

    [selDOCNO]= [DOCNO]



  7. #7
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Access is not case sensitive.
    At least not by default?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Changing case of a table field
    By Kundan in forum Programming
    Replies: 9
    Last Post: 03-28-2018, 10:03 PM
  2. Case for in case field corrupt
    By Ruegen in forum Forms
    Replies: 9
    Last Post: 08-03-2014, 07:56 PM
  3. Replies: 3
    Last Post: 08-22-2012, 09:01 AM
  4. Replies: 14
    Last Post: 11-16-2010, 03:56 PM
  5. Replies: 0
    Last Post: 08-08-2008, 08:34 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