Results 1 to 3 of 3
  1. #1
    blacklistkilua is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Aug 2014
    Posts
    3

    primary key with two different input mask..help please


    i have a text box which will I input primary..The input mask of the primary key will depend if it is executive or talents..

    the primary key should look like this if it is executive "0-12345" and if talents it should look like this "123456"

    please help me..i dont know how to start..im stuck..

    thanks for the help

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    you would have to do this in the form during data entry.
    depending on the combo for exec/talent, you can force the primary key.

    (also have an autonum field)

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    How are you telling Access whether a given Record is for executive or talent?

    If you have a Field/Control named Status, you could use something like

    Code:
    Private Sub Status_AfterUpdate()
    
     If Me.Status = "Executive" Then
       Me.YourPrimaryFieldName.InputMask = "0\-000000"
     Else
       Me.YourPrimaryFieldName.InputMask = "000000"
     End If
    
    End Sub

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Input Mask
    By PRHoff in forum Access
    Replies: 2
    Last Post: 02-19-2015, 09:00 AM
  2. Input mask
    By scorpion99 in forum Access
    Replies: 4
    Last Post: 02-21-2014, 02:18 AM
  3. input mask
    By slimjen in forum Forms
    Replies: 7
    Last Post: 10-07-2013, 03:20 PM
  4. Input Mask
    By qbc in forum Access
    Replies: 2
    Last Post: 01-20-2012, 03:27 PM
  5. Input mask
    By doobybug in forum Access
    Replies: 2
    Last Post: 06-17-2009, 09:40 PM

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