Results 1 to 2 of 2
  1. #1
    tariq nawaz is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Aug 2012
    Posts
    31

    stuck if filed x is 10 character select "A" if field x is 16 characters select "B"

    hello all



    i am stuck so badly.
    if the user enter 10 characters in field say "X" i need to Auto select carrier "A" in field Y
    but if the user enter 16 characters in field X i need to Auto select carrier "B" in field Y




    Regards

    A learner

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    in the ON EXIT property of your FIELD_A (the field that contains your 10 or 16 digit string)
    FIELD_B is the field where you want A OR B to appear based on what the contents of FIELD_A are.

    Code:
    IF len(FIELD_A) = 10 then
        FIELD_B = "A"
    Elseif len(FIELD_B) = 16 then
        FIELD_B = "B"
    ELSE
        ' Any other conditions of the value of FIELD_A
    endif

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

Similar Threads

  1. Replies: 2
    Last Post: 06-12-2012, 09:47 AM
  2. Replies: 16
    Last Post: 11-01-2011, 01:35 PM
  3. Replies: 16
    Last Post: 07-22-2011, 09:23 AM
  4. ComboBox "Select" and "DLookUp"
    By witooldas in forum Forms
    Replies: 0
    Last Post: 03-23-2011, 03:31 AM
  5. SELECT a "TWO WORD" field
    By doci4a in forum Queries
    Replies: 11
    Last Post: 03-10-2011, 03:17 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