Results 1 to 6 of 6
  1. #1
    andy-29 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Culver City
    Posts
    34

    Post AutoNumber Field Format

    I have a Style #(foreign key) field that is a lookup from another table.


    I'd like to somehow modify the format/display of the ID field.
    The ID field will pickup the Style# chosen from the combo box and combine it with the ID field???
    ex: user chooses style # from the combo box "T5640", ID field would now show T5640-1 (Style # + autonumber increments)
    Is is possible??

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The ID field is an autonumber data type? Can't modify the data in table but can calculate a value in query or in textboxes by concatenating the two fields. The ampersand character is preferred concatenation operator (as opposed to + sign).

    [Style #] & ID

    BTW, advise not to use spaces, special characters, punctuation (underscore is exception) in any names, nor reserved words like Date as names.
    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
    andy-29 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Culver City
    Posts
    34
    ID field is autonumber.
    I created "Image ID" field in the same table as the ID and Style # fields. Table name marker details.
    I'd like to have Image ID field to have default value = [Style #] &"-"[ID]. How do I go about this?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    This is a calculated data type field in table? I haven't used those yet. See if the calculated field will accept concatenation expression. Otherwise, will need code to save this value into a text field. Don't advise saving this calculated data into table. Calculate it whenever need.
    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.

  5. #5
    andy-29 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Culver City
    Posts
    34
    Hi,

    I attached test db. I think almost got it. The only thing I'm not getting is when I create a new record on the marker details subform the Image ID is only getting updated with the Style # field but it will not append the ID field - [Style #]&"-"&[ID]. Maybe you can figure out??

    Thanks!
    Attached Files Attached Files

  6. #6
    andy-29 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Culver City
    Posts
    34
    Ok, solved it using the calculated type field...works with concatenate and I got what I needed

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

Similar Threads

  1. Customizing the Autonumber field
    By wasim_sono in forum Access
    Replies: 3
    Last Post: 10-24-2014, 03:00 PM
  2. Replies: 1
    Last Post: 09-25-2012, 03:58 AM
  3. Using Dcount on an Autonumber Field
    By rfs in forum Forms
    Replies: 0
    Last Post: 03-17-2011, 10:04 AM
  4. Manually autonumber a field
    By apsf68 in forum Access
    Replies: 15
    Last Post: 11-13-2010, 04:04 PM
  5. Autofill field based on autonumber field
    By frevilla in forum Forms
    Replies: 1
    Last Post: 09-11-2009, 02:50 AM

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