Results 1 to 4 of 4
  1. #1
    ksor's Avatar
    ksor is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Feb 2017
    Posts
    126

    QUERY in forms datasource wont work ??

    I have a query saved called "PERSON Opslag på" and it shows me what I want - it looks like this:

    SELECT [PERSON Opslag på].PersonID, [PERSON Opslag på].Fornavn, [PERSON Opslag på].Efternavn, [PERSON Opslag på].Køn, [PERSON Opslag på].Standardtype, [PERSON Opslag på].Hændelsesdato, [PERSON Opslag på].StedNavn FROM [PERSON Opslag på]

    I now use this query in a combobox as datasource but with a criteria - like shown here:

    SELECT [PERSON Opslag på].PersonID, [PERSON Opslag på].Fornavn, [PERSON Opslag på].Efternavn, [PERSON Opslag på].Køn, [PERSON Opslag på].Standardtype, [PERSON Opslag på].Hændelsesdato, [PERSON Opslag på].StedNavn FROM [PERSON Opslag på] WHERE ((([PERSON Opslag på].Køn)<>"K"));



    Now it shows ALL records - too where Køn<>"K" - if I open up the SQL and run it it works fine !

    It seems like you CAN'T add a criteria afterwards - do I really have to make 2 seperate queries ????

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Can't you just make the combobox rowsource using the query design view? Including the where?


    Sent from my iPhone using Tapatalk

  3. #3
    ksor's Avatar
    ksor is offline Competent Performer
    Windows 10 Access 2007
    Join Date
    Feb 2017
    Posts
    126
    Quote Originally Posted by andy49 View Post
    Can't you just make the combobox rowsource using the query design view? Including the where?


    Sent from my iPhone using Tapatalk
    That's what I did ... but I have found out I used a bad reference to a field in the condition ;-((

  4. #4
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Sorted?


    Sent from my iPhone using Tapatalk

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

Similar Threads

  1. Why wont my form work?
    By AishlinnAnne in forum Forms
    Replies: 14
    Last Post: 08-19-2016, 09:37 AM
  2. Insert into query that just wont work.
    By todmac in forum Queries
    Replies: 3
    Last Post: 11-26-2014, 03:19 PM
  3. Insert statement wont work
    By todmac in forum Access
    Replies: 1
    Last Post: 09-15-2013, 05:13 PM
  4. DoCmd.MoveSize wont work
    By gbmarlysis in forum Programming
    Replies: 3
    Last Post: 03-02-2012, 06:24 PM
  5. Query and subquery wont work with combo box
    By jbg8931 in forum Queries
    Replies: 0
    Last Post: 05-09-2010, 10:24 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