Results 1 to 3 of 3
  1. #1
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151

    Formatting a field based on other data

    I have multiple ID types (FEIN, SSN, and 2 different internal department numbers) which can be used as the ID for a case (not the primary key. Primary key is a autonumber). However each of these have their own distinct format. When printing a summary sheet for each case, we want the ID type "FEIN," "SSN," "Cert," or "BP" printed and then the formatted value for that ID type.



    I had this working pretty well up to a point. When adding a new record, I determined the id type, based on whether the user populated the FEIN field, the SSN field, the "Cert" field or the BP field, and saved the literal ("FEIN," "SSN," "Cert," or "BP") to a field called "id type" and then copied the value from the specific fields to a second field called "id text" and used the appropriate input mask based on the id type. So far, so good.

    HOWEVER, when I was updating an ID (presuming that it had been entered incorrectly), I could not get the ID type field and ID text field to update correctly and format correctly.

    I'm not sure if all this manipulation is the way to go,,,, or if there is a way to do some code or unbound fields on the summary sheet, that will pick up the field that has data in it and the appropriate formatting.

    Thanks in advance!!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Think I would not have multiple fields for these ID's, assuming a case can have only 1 of the 4 possible. Could use code in the AfterUpdate event of IDtype to set the input mask property of the IDtext box. Also have the IDtext box set as not Enabled until the IDtype is input and then code will set Enabled Yes. Can set the mask to save the value with punctuation so formatting of these values is not an issue for reports.
    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
    msmithtlh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    151
    That's a good approach. Thank you.

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

Similar Threads

  1. Limit data entry based on another field
    By chemengr in forum Forms
    Replies: 5
    Last Post: 01-02-2014, 01:21 PM
  2. Replies: 2
    Last Post: 03-07-2013, 04:50 PM
  3. Sum Data Based on Date Field
    By Can5er in forum Access
    Replies: 2
    Last Post: 10-03-2012, 07:19 PM
  4. data field in query twice based on criteria
    By sandyg in forum Queries
    Replies: 1
    Last Post: 09-29-2011, 07:47 AM
  5. Populate one field based upon another fields data
    By BigBrownBear in forum Queries
    Replies: 1
    Last Post: 03-23-2010, 04:27 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