Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    bubai is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Nov 2014
    Location
    Dhaka
    Posts
    68
    Quote Originally Posted by mike60smart View Post
    Hi

    Sorry but I stick with my opinion that you should have a field for Station and actually store the StationID from your list of Stations.

    This would enable you to search quite easily for a specific Station

    Luck with your Project
    Thanks for your advice mate. But I have no difficulty in querying for stations.


    My query generation form "Form1" has multiple comboboxes for multiple query criteria. If I select values for all the comboboxes the query then returns appropriate result. But the problem occurs when I don't want a query result using all criteria. I then fill only the required combobox for the required query result and leave the unwanted comboboxes blank. It then return no result.

  2. #17
    bubai is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Nov 2014
    Location
    Dhaka
    Posts
    68
    Quote Originally Posted by Bob Fitz View Post
    bubai

    Do not use lookups in tables. Use lookups on forms.

    Good luck with your project.
    I understand the perils of using lookup field. Few fields in which I have lookup field was created at the initial stage. But they are not in use. I have shifted them to form. I will clear all of them once I finalize the design.
    But can you help me with the query generation form problem?

  3. #18
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    2,507
    Quote Originally Posted by bubai View Post
    I understand the perils of using lookup field. Few fields in which I have lookup field was created at the initial stage. But they are not in use. I have shifted them to form. I will clear all of them once I finalize the design.
    But can you help me with the query generation form problem?
    Perhaps:
    Code:
    SELECT Cons.Import_ID, Cons.Description, Cons.[Brand_ID>], Cons.[Supplier_ID>], Cons.BigQty, Cons.SmallQty, Cons.BankValue, Cons.ActuValue
    FROM Cons
    WHERE (((Cons.Import_ID) Like "*" & [Forms]![Form1]![Station] & "*" Or [Forms]![Form1]![Station] Is Null) AND ((Cons.Description)=[Forms]![Form1]![Des] Or [Forms]![Form1]![Des] Is Null));
    as the query to use when Form1 is open
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #19
    bubai is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Nov 2014
    Location
    Dhaka
    Posts
    68
    Quote Originally Posted by Bob Fitz View Post
    Perhaps:
    Code:
    SELECT Cons.Import_ID, Cons.Description, Cons.[Brand_ID>], Cons.[Supplier_ID>], Cons.BigQty, Cons.SmallQty, Cons.BankValue, Cons.ActuValue
    FROM Cons
    WHERE (((Cons.Import_ID) Like "*" & [Forms]![Form1]![Station] & "*" Or [Forms]![Form1]![Station] Is Null) AND ((Cons.Description)=[Forms]![Form1]![Des] Or [Forms]![Form1]![Des] Is Null));
    as the query to use when Form1 is open
    Thanks mate. But is it possible to plot in the query grid?

  5. #20
    mike60smart is online now Competent Performer
    Windows 10 Access 2016
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    374
    Hi bubai

    What Bob has given you is the Record Source for the Form

    If you Paste the SELECT ... statement into the Record Source of your Form in Design View you are then able to access the Query Grid by Clicking on the Elipse (...) at the end of the Record Source Row.

    Here is an example Form in Design View
    Attached Thumbnails Attached Thumbnails RS.JPG  

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 11-11-2014, 06:10 PM
  2. Wildcard within a combobox
    By T_Tronix in forum Access
    Replies: 10
    Last Post: 11-21-2013, 03:35 PM
  3. Replies: 3
    Last Post: 10-31-2012, 12:50 PM
  4. Replies: 1
    Last Post: 08-13-2012, 03:38 PM
  5. Problem with a wildcard in a query criteria
    By desk4tbc in forum Programming
    Replies: 1
    Last Post: 08-10-2011, 06:02 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 - Senior Forums