Results 1 to 4 of 4

Populate textbox based on first letter of another field.

  1. #1
    AccessPower's Avatar
    AccessPower is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    151

    Populate textbox based on first letter of another field.

    Is it possible to do this? If I have a report that lists C4501, can I populate another textbox with City? Or S4560 would populate the field with Suburb.

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    2,550
    You would do it with an If statement in the AfterUpdate event of the field. Not sure what you meant by "report".

  3. #3
    Bulzie is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    902
    In the Control Source of the Text field(replace Field1 with your report field name):

    = IIf Left([Field1],1) = "C", "City", IIf Left([Field1],1) = "S", "Suburb","NA")

  4. #4
    AccessPower's Avatar
    AccessPower is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2016
    Posts
    151
    Thanks. This worked well.

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

Similar Threads

  1. Populate Subform field with textbox
    By MichelleVL in forum Access
    Replies: 3
    Last Post: 11-04-2016, 06:22 AM
  2. Replies: 8
    Last Post: 03-24-2015, 08:56 AM
  3. Replies: 2
    Last Post: 08-21-2013, 08:39 AM
  4. Replies: 1
    Last Post: 03-01-2012, 03:35 AM
  5. Unable to populate textbox based on listbox
    By marcustofeles in forum Forms
    Replies: 21
    Last Post: 10-24-2011, 06:18 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
  •  
Tech Forums: Microsoft Office Forums