Results 1 to 4 of 4
  1. #1
    michaelxhermes is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2015
    Posts
    6

    Form which runs a query to use in a look up validation of later entry

    Form which runs a query to use in a look up validation of later entry

    I have a query which uses the form value as the selection criteria - this works

    I have 2 entries on the form customer and instructor id.

    How do I have a second entry which is a look up based on a query depending on the other form value ?

    I cannot get this to work.. when the top id changes the look up list based on the query should change...

    "The list of instructors available for selection should be restricted to those that match the level of
    the customer."

    I have attached the database I am using.



    Many thanks for your help and advice
    Attached Files Attached Files

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Add an unbound textbox to the form, Level. In the AfterUpdate of the customer:
    Me!Level=Me!customer.Column(4)
    Me!instructor.Requery

    Then in the query for the instructor, set the criteria as you did in your second db - altho the instructions above say it must be the same level, not the same customer.

  3. #3
    michaelxhermes is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2015
    Posts
    6
    Thanks, I will try this.. much appreciated.

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Code:
    Option Compare Database
    Option Explicit
    
    
    Private Sub customer_ID_AfterUpdate()
     instructor_ID.RowSource = "SELECT [Instructor Details].[Instructor ID], [Instructor Details].[Instructor name], " _
     & "[Instructor Details].[Instructor level], [Instructor Details].[Lesson price adult], " _
     & "[Instructor Details].[Lesson price child] FROM [Instructor Details] " _
     & "WHERE [Instructor Level]= '" & customer_ID.Column(4) & "';"
    End Sub
    Add this code to the booklesson form.

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

Similar Threads

  1. Search form - Runs a query - Export to Excel
    By ryanmce92 in forum Forms
    Replies: 5
    Last Post: 04-16-2015, 06:16 AM
  2. Data entry validation rule in Form
    By accessn00bie in forum Access
    Replies: 3
    Last Post: 12-07-2012, 01:11 PM
  3. Replies: 2
    Last Post: 11-19-2012, 03:23 AM
  4. Datasheet entry validation
    By Fstrategic in forum Access
    Replies: 2
    Last Post: 01-19-2012, 07:07 AM
  5. Form that runs query and creates reports
    By Valeda in forum Forms
    Replies: 2
    Last Post: 05-04-2006, 07:01 AM

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