Results 1 to 4 of 4
  1. #1
    Michael1839 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2012
    Posts
    2

    validation of two fields against a specific range

    Hello and thank you for reading my question. I am using Access 2007. This is the problem; I have a warehouse divided into four departments North, East, South, and West. Each department is assigned its own storage location range North is N1-N1000, East is E1-E1000, South is S1-S1000, and West is W1-W1000. On the access input form of my database are two fields, one combo box field for Department and one combo box field for location stored. When the user is updating the data base for parts received or shipped, the user must enter the department and location stored to correctly debit or credit that department. The location stored entered must be assigned to the department. (Example: dept. is north and storage location is N65, the user enters D65 instead, error message is displayed, "you have entered the wrong location"). What I need is instructions how to write the code to check the fields to verify location stored matches department, and display a warning message. How do I do this? I have a table with department names and storage location ranges.


    Thanks for your help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Maybe you need cascading comboboxes http://www.datapigtechnologies.com/f...combobox2.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Michael1839 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2012
    Posts
    2
    Hello, Thanks for the quick reply. That is not exactly what I am looking. when the data entry person fills the department field, the person must enter the warehouse location where the item will be stored or removed from. example North department has the space in the warehouse area of N1-N1000 each space is a location. If the location is not between N1-N1000 an error will display. I am unable to get the location field to look at the department field and the assigned locations to check what is entered into the location field.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    But if the location combobox list is restricted to only locations associated with department, user cannot select an invalid location.

    You have a table that shows association of departments with locations? Provide example of this table.

    In order for search and filter of the location identifiers to work properly since the values are text, they will all have to be the same length using filler zeros as necessary, like:

    N0001 - N1000

    Otherwise, N1000 will sort before N2.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 7
    Last Post: 12-30-2013, 09:53 AM
  2. Selecting from specific Date and Time range
    By LindaRuble in forum Programming
    Replies: 1
    Last Post: 05-15-2013, 07:37 AM
  3. Select range instead of specific
    By cactuspete13 in forum Forms
    Replies: 5
    Last Post: 02-18-2013, 09:33 PM
  4. SELECT a specific DATE RANGE in Query
    By taimysho0 in forum Queries
    Replies: 28
    Last Post: 06-04-2012, 04:58 PM
  5. Validation Rule for specific answer
    By GraemeG in forum Programming
    Replies: 20
    Last Post: 02-13-2011, 12:38 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