473,324 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Select Query criteria feeding from subform

Hi there,

I have created a form, "search" and a query "search_product". The query returns the product information based upon the criteria for three of the fields, author, title or isbn. The field names on the search form are search_title, search_author and search_isbn. The string entered in the query criteria is:

Like [Forms]![search]![search_author]

This works perfectly. But now I need to take the search form and make it a subform in a form called "main". I edited the query to reflect the new position of the search field;

Like [Forms]![main]![search_subform]![search_author]

Now the query runs (no errors or asking what is contained in the field - when the main form is open in form view BUT it always returns every result from the query - nothing is being filtered.

My question is, why isn't the query working properly once I make the search form a subform and edit the query accordingly??
Sep 15 '06 #1
3 9615
PEB
1,418 Expert 1GB
Hi,

try:
Like [Forms]![main]![search_subform].Form!![search_author]

:)

Hi there,

I have created a form, "search" and a query "search_product". The query returns the product information based upon the criteria for three of the fields, author, title or isbn. The field names on the search form are search_title, search_author and search_isbn. The string entered in the query criteria is:

Like [Forms]![search]![search_author]

This works perfectly. But now I need to take the search form and make it a subform in a form called "main". I edited the query to reflect the new position of the search field;

Like [Forms]![main]![search_subform]![search_author]

Now the query runs (no errors or asking what is contained in the field - when the main form is open in form view BUT it always returns every result from the query - nothing is being filtered.

My question is, why isn't the query working properly once I make the search form a subform and edit the query accordingly??
Sep 16 '06 #2
I cannot thank you enough PEB!!!! I used [Forms]![main]![search_subform].Form![search_author] (single exclamation mark) and it worked like a charm. Thanks again.

Have a great day!

Hi,

try:
Like [Forms]![main]![search_subform].Form!![search_author]

:)
Sep 18 '06 #3
@stevecat
I'm a new user to access and I'm wondering if I'm missing somethign simple here. I have list box in a subform and I want that to control which records I see from a query. I've included some images below and I'm hoping you can help me find where I messed up.


Mar 14 '17 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Therese A. Sorna | last post by:
Hello all... I am using Access 2002, and am trying to find a way for a user to be able to select multiple entries from a drop-down list. I am hoping that given a list as such: a b c d
19
by: William Wisnieski | last post by:
Hello Everyone, I have a main form with a datasheet subform that I use to query by form. After the user selects two criteria on the main form and clicks the cmdShowResults button on the main...
3
by: cassandra.flowers | last post by:
Hi, I was wondering if it is possible (Using access) to have a query parameter as a drop down box rather than a text box? e.g. typing as criteria for a query produces a box with a text box...
2
by: JM | last post by:
Hello, I've created a Querydef in a Form_Load() sub. The form is a subform that no longer has linked child fields. The form is bound to this querydef. When I open the form, the fields are...
9
by: MLH | last post by:
I have a table (tblCorrespondence) holding records with fields like , , , , , , , etc... About a dozen 's are defined and I often use queries to extract records of a given . That's pretty easy....
7
by: keliie | last post by:
Hello Just a quick question that I've spent a few hours trying to solve with no luck (although one would think this should be fairly easy). I have a form with a subform. The subform is based...
1
by: Regnab | last post by:
I've got a form where the user can edit the lookups available in the database. It consists of a list box of the various categories on the main form, a checkbox on the main form and a sub form which...
0
by: TD | last post by:
I have a main form with two subforms (both in datasheet view), neither of which are linked to the main form. The main form is based on a query that uses the bound column of a combobox on the main...
11
by: woodey2002 | last post by:
This problem is driving me crazy. Hello there, i am trying to create a search form for records in my access database. The search form will contain text boxes and a multi select list box. The user...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.