Results 1 to 5 of 5
  1. #1
    romi is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    7

    Using union Query to subform

    Dear All..
    How to using union query to subform..?
    i used union query for combobox to select employee name, shown below picture..

    Click image for larger version. 

Name:	1.jpg 
Views:	17 
Size:	30.6 KB 
ID:	31959

    when i close the form, and open form again, field of employee name is blank..


    Click image for larger version. 

Name:	capture-20180106-152249.png 
Views:	17 
Size:	5.4 KB 
ID:	31960

    How to solve this problem..?
    thank you..

  2. #2
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Please provide the record source used as a sql statement
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    What is the combobox RowSource when the form opens? Do you use code to modify the RowSource after form opens?
    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.

  4. #4
    romi is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    7
    Quote Originally Posted by ridders52 View Post
    Please provide the record source used as a sql statement
    my sql in row source :

    SELECT Q_uniontask.ID, Q_uniontask.Employee Name, Q_uniontask.stardate, Q_uniontask.Enddate FROM Q_uniontask WHERE (((Q_uniontask.Employee Name) Not In (SELECT [Employee Name] FROM [Q_uniontask] WHERE Forms![Task Form]![Startdatefrm] BETWEEN [startdate] AND [Enddate] OR Forms![Task Form]![Enddatefrm] BETWEEN [Startdate] AND [Enddate)));

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    This is a conditional query. The names won't display because they are alias values and their records are not in the combobox RowSource, therefore the alias values are not available for display. This must be expected when using conditional query. This is a known issue with Continuous and Datasheet forms. Many, many, many discussions on this topic. Also known as cascading or dependent comboboxes. Usually requires VBA code to manage.
    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: 4
    Last Post: 08-09-2017, 12:06 PM
  2. Convert Union Query to non-union help
    By Ekhart in forum Queries
    Replies: 2
    Last Post: 01-10-2017, 03:39 AM
  3. Replies: 4
    Last Post: 12-20-2015, 02:35 PM
  4. Replies: 8
    Last Post: 10-22-2012, 07:43 PM
  5. Union Query
    By jlclark4 in forum Queries
    Replies: 3
    Last Post: 02-25-2011, 08:21 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