Results 1 to 3 of 3
  1. #1
    NickWren is offline Advanced Beginner
    Windows XP Access 2013
    Join Date
    Dec 2015
    Location
    Connecticut
    Posts
    70

    Calculated field to another field

    Is there a way to write a vba script that will take a calculated field and write it as a string in a short text field.

    Calculated field (WrenID):
    [FacilityAbbr] & "-" & [ID]

    [FacilityAbbr] = "PL"
    [ID] = autonumber "000#"

    Short Text(WrenIDString):
    "PL-0001"

    VBA SCRIPT? clearly I would need more for this to happen, and can I do this in a table or will it have to be in a form?



    WrenIDValue = Me!WrenID.Value
    WrenIDStringValue = Me.WrenIDValue




    I need this for bringing over excel tables into access:

    my access table creates a unique ID that we use to call all our samples, the excel spreadsheets have the unique ID as the sample name; however now there is no way to say the name on the excel spreadsheet = the unique ID that Access creates due to it being a calculated field.

  2. #2
    NickWren is offline Advanced Beginner
    Windows XP Access 2013
    Join Date
    Dec 2015
    Location
    Connecticut
    Posts
    70
    Here is an example of my problem: AccessForum.zip

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    The simple answer is almost certainly. I successfully imported the xlsx file with no errors by lettingn Access create the Primary Key field. What you want done can be accomplished in a stand alone module.

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

Similar Threads

  1. Replies: 8
    Last Post: 01-06-2016, 02:52 PM
  2. Replies: 2
    Last Post: 12-30-2014, 01:32 PM
  3. Replies: 2
    Last Post: 12-15-2013, 02:29 AM
  4. Replies: 1
    Last Post: 04-21-2013, 03:20 PM
  5. Replies: 3
    Last Post: 02-13-2013, 10:15 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