Results 1 to 7 of 7
  1. #1
    BillySpivy is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2017
    Posts
    4

    Restrict Data Entry


    Hello,

    Is there a way to restrict data entry on a form to 1 of 3 formats?

    P-123456
    W-123456
    AFR-12345

    Whereas if it's a purchase order it will be: "P-" followed by the number
    If it's a work order it will be: "W-" followed by the number
    If it's from a repair it will be: "AFR-" followed by the number

    Thank you for any help

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You may want to consider three separate subforms, making them visible/invisible depending on the entry.

  3. #3
    BillySpivy is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2017
    Posts
    4
    This entry is a column on a subform for parts used for the repair indicating where the part came from for tractability. The users sometimes but many spaces or lower case letters or just about any way they feel like. So it's difficult to keep things in order is why I asked.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Oh!

    Create an option group field, for one of the three types. Then add the prefix to the number they enter using VBA.

  5. #5
    BillySpivy is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2017
    Posts
    4
    Okay that sounds reasonable but how to do?

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    In the AfterUpdate event of the number field:
    If Me!frame_field_name=1 Then
    Me!concat_field_name="P-" & Me!number_field_name
    ElseIf Me!frame_field_name=2 Then
    ...etc

  7. #7
    BillySpivy is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Oct 2017
    Posts
    4
    Thanks for the suggestion but I will edit the data as needed. It seems too complicated for me.

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

Similar Threads

  1. How to restrict data input.
    By Yodo in forum Access
    Replies: 3
    Last Post: 06-15-2017, 04:35 AM
  2. Replies: 7
    Last Post: 03-05-2015, 07:34 AM
  3. Restrict data entry to preset list
    By chrisfl in forum Forms
    Replies: 2
    Last Post: 06-28-2013, 01:16 PM
  4. Replies: 2
    Last Post: 10-25-2012, 02:39 PM
  5. Using Validation rules to restrict certain types of data entry.
    By Long Tom Coffin in forum Database Design
    Replies: 3
    Last Post: 07-23-2012, 10:38 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