Results 1 to 6 of 6
  1. #1
    srj1957 is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    3

    Question What is the easiest/better way to Validate data entry...

    Yes a total Newbie to Access Forms and I have searched the forum and found many ways to validate data entered in a form, but which is the easiest / Best to use here in this scenario...



    Here is the requirement

    I have a 4 Field FORM that data is entered in to populate, let's say "Table Z" ...

    Field 1 -REQUIRED Field - When user enters data - it must be on Dictionary Table X

    Field 2 -REQUIRED Field - When user enters data - it must be on Dictionary Table Y

    Field 3 -REQUIRED Field

    Field 4 -REQUIRED Field

    Do I use BeforeUpdate, AfterUpdate, DoLookup, a Query ???..
    Please help !!

    Hopefully someone out here will help and point me in th right direction to get me solution
    Last edited by srj1957; 08-19-2010 at 09:40 AM. Reason: Better title

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    For each of the first 2, I'd probably use a combo box that got its selections from the other table (row source property), with its limit to list property set to yes. Set all 4 to required in the table and Access will do all the work for you.

    If you wish to do your own validation, the proper place is the before update event:

    http://www.baldyweb.com/BeforeUpdate.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    srj1957 is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    3
    Quote Originally Posted by pbaldy View Post
    For each of the first 2, I'd probably use a combo box that got its selections from the other table (row source property), with its limit to list property set to yes. Set all 4 to required in the table and Access will do all the work for you.

    If you wish to do your own validation, the proper place is the before update event:

    http://www.baldyweb.com/BeforeUpdate.htm
    Thanks for the reply I appreciate your time and advice ...

    Yes I saw the combo option, and gave it a try... but it's a bit cumbersome having to scroll thru over 7,000 recs to find the codes. (or I'm using the ComboBox incorrectly )

    I preferably like to let them enter a code and then go check against the tables to see if it's valid, but again not sure on how to do that... is that a query or is there an automatic table check option ... ...if you get what I mean

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You can still type into a combo box. With its auto expand property set, it will move through the selections as you type. With limit to list set to yes, the combo will not let the user make an invalid selection. If you want to test after the fact, you can set limit to list to no and then do your checking in the before update event of the form as in the link. The simplest way would be a DCount(); more on syntax here:

    DLookup Usage Samples

    But I'd just let the limit to list do the work.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    srj1957 is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    3

    Time and Money saved

    Quote Originally Posted by pbaldy View Post
    You can still type into a combo box. With its auto expand property set, it will move through the selections as you type. With limit to list set to yes, the combo will not let the user make an invalid selection. If you want to test after the fact, you can set limit to list to no and then do your checking in the before update event of the form as in the link. The simplest way would be a DCount(); more on syntax here:

    DLookup Usage Samples

    But I'd just let the limit to list do the work.
    Thank you VERY much, I went with your suggestion of using a COMBO BOX ...the two options [ auto expand property & limit to list set ] did the trick...

    A side note... [With education cut-backs here,they just said RTFB and learn it on your own instead of going to a class...
    I was "working" on this for two days and trying to find the solution InTFB, then within minutes of asking on this forum you resolved the problem ... ]

    I can't thank you enough for the time you saved me...

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

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