473,378 Members | 1,383 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,378 software developers and data experts.

Customize Filter in Inventory Template to use a value input by user

Catalyst159
111 100+
I am trying to create a filter using the Filter that is found in an Inventory Template. I have attached the Inventory Template as a .zip for reference.

There is a (Filter Details) form which uses the (Filters) table as its Record Source. The table consists of a (Filter String) field, which contains something like the following:

(Inventory Extended) is a QUERY here, which contains a (Category) Field which is a combo box (value list) containing ("1) Category";"2) Category";"3) Category")

Filter String looks like the following:
Expand|Select|Wrap|Line Numbers
  1. ([Inventory Extended].[Category]="1) Category")
My situation is a little different. I have a QUERY called (Marriage Inventory Extended), which contains a (Name of Bride) field which is a textbox. I want to create a Filter String so the user is prompted to input a (Name of Bride) value.

I have tried the following Filter String:
Expand|Select|Wrap|Line Numbers
  1. ([Marriage Inventory Extended].[Name of Bride])
This does not seem to work, I am not presented with a prompt to input a Name for Name of Bride.

However when I use a Filter String like:
Expand|Select|Wrap|Line Numbers
  1. ([Marriage Inventory Extended])
I am then presented with a Marriage Inventory Extended, "Enter Parameter Value" input box. This is what I want but for inputting the Name of a Bride. Any help or suggestions would be greatly appreciated.

The Inventory template I am using is attached as Inventory.zip if you would like to check it out. It might give you a better understanding of what I am trying to accomplish here.

Thanks.
Attached Files
File Type: zip Inventory.zip (286.7 KB, 59 views)
Dec 9 '11 #1
13 2075
NeoPa
32,556 Expert Mod 16PB
When you connect two bracketed ([]) items together with a dot (.) it assumes you are referring to an accessible field in an accessible table. If you want to prompt the user you should understand that anything contained within brackets (without a proximate dot) which is not recognised by SQL will trigger the prompting process.

So :
Expand|Select|Wrap|Line Numbers
  1. SELECT [Any old rubbish in here]
is fine, whereas :
Expand|Select|Wrap|Line Numbers
  1. SELECT [Any old rubbish].[in here]
is treated as a reference which is just wrong.
Dec 9 '11 #2
Catalyst159
111 100+
So should it be something like this:
Expand|Select|Wrap|Line Numbers
  1. ([Marriage Inventory Extended.Name of Bride])
Dec 9 '11 #3
NeoPa
32,556 Expert Mod 16PB
I'm afraid I'm not very clear on what you want. Your question has a lot of words in it, but doesn't make too much sense that I could fathom. What you have will simply prompt the user with the text between the brackets. If that's your ultimate aim, then it will do that. If not, then it won't. If you're trying to link this into a field somewhere, as well as prompt the user to provide the data then I have no idea what's going on with your thinking, but it won't do anything like that.
Dec 9 '11 #4
Catalyst159
111 100+
I just tried the following:

Expand|Select|Wrap|Line Numbers
  1. ([Marriage Inventory Extended].[Name of Bride] Like "*Underhill*")
And this filter does work. But here it automatically filters for Underhill. I want to have the user prompted to enter the value "Underhill". I do not want to have to include Underhill in the (Filter String).
Dec 9 '11 #5
NeoPa
32,556 Expert Mod 16PB
In that case try :
Expand|Select|Wrap|Line Numbers
  1. ([Marriage Inventory Extended].[Name of Bride] Like '*' & [Your prompt] & '*')
Dec 9 '11 #6
Catalyst159
111 100+
This seemed to work:
Expand|Select|Wrap|Line Numbers
  1. ([Marriage Inventory Extended].[Name of Bride]) Like "*" & [Name of Bride] & "*"
Dec 9 '11 #7
Catalyst159
111 100+
Thanks for your help Neo.
Dec 9 '11 #8
NeoPa
32,556 Expert Mod 16PB
It would work but :
  1. The parentheses are not required where you have them. Entirely redundent there. Where I had them allowed this whole condition to be used with other conditions without any confusing of items. Essentially, it is a good idea to parenthesise the whole condition, but no benefit whatsoever to do so for the field reference.
  2. Double-quotes (") are not the correct quotes to use in SQL. They work in Access (only) because it translates for you. The correct quotes are single ones (').
  3. [Name of Bride] is risky. I would have expected that to recognise the (albeit unqualified) field name and use that instead of prompting. If it doesn't then you've dodged one and got lucky. Remember though, whatever you use must not be recognisable as a valid item otherwise it will use that instead of prompting.
Dec 9 '11 #9
Catalyst159
111 100+
I see what you are saying about the parentheses, that makes sense. Good call. I will modify what I have. Thanks again Neo. I really appreciate it.

Also I forgot to mention. In order for me to get this to work I had to setup a parameter called Name of Bride in the Marriage Inventory Extended Query. Doe that make sense to you. It did not work until I created the parameter as par of the query.
Dec 10 '11 #10
NeoPa
32,556 Expert Mod 16PB
Catalyst159:
Also I forgot to mention ...
That would explain why it worked. This pertains to my point #3, and explains how you avoided the problem. The simpler way would have been to use a string which didn't match an existing field name. [Name of Bride?] (for instance) would have avoided the necessity to create a parameter specification for the name.

Does that make sense?
Dec 11 '11 #11
Catalyst159
111 100+
Why did you edit my post. Also I forgot to mention ... It makes perfect sense. You are right, I should have changed the string name to something unique. Thanks for the input.
Dec 11 '11 #12
NeoPa
32,556 Expert Mod 16PB
Catalyst159:
Why did you edit my post
Every edited post notification should come with a reason (Mine all do certainly). You don't identify the post you're referring to so, as I can only see one in this thread you may mean, the reason for that one was the layout just made it hard to read. Leaving white space can be helpful at times but how you had it was not conducive to reading and understanding the question easily. For best results, as long as it doesn't involve compressing the details together too much, a post should be readable without having to scroll any more than necessary.

It certainly helps to separate paragraphs, but not all paragraphs should be a single sentence and only one blank line is ever required for that comfortable, readable effect.

Nothing germane of your post was changed, and there were no rules broken. I was just tidying it up a little.
Dec 11 '11 #13
Catalyst159
111 100+
I understand. Thank you for clarifying that.
Dec 11 '11 #14

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

Similar topics

3
by: N?ant Humain | last post by:
I have just begun learning Python so that I can write a simple script to make modification of a file used by another Python script easier. This file is basically a list of regular expressions. What...
1
by: Barry | last post by:
I have a DataList in which I need to dynamically load a SelectedItemTemplate. However, I ended up turning the template into a User Control because I needed code behind. The reason I did this was...
1
by: Julius Fenata | last post by:
Dear all, I need help to change my item-template value format... Here is my case, I have a datagrid, with 'SubjectPrice' field, and when the grid displayed, my 'SubjectPrice' field displayed...
2
by: Anandan | last post by:
Hi, In our Project we use Dataset to load the Grid with Values. We have some criteria to filter the values to be shown in the Grid. For that we used the SELECT command to filter the Same...
2
by: Brian Henry | last post by:
say i have a dataset called dv and i have a boolean value i want to filter by "b_DoesWork" while the column name in the data view that i want to filter on is called "Works" how would i filter...
2
by: espositozero | last post by:
Hello... I'm REALLY new to this whole thing, so if you all don't mind speaking in lamens terms for me... What I want to do seems like it should be simple, but I've been searching everywhere and I...
1
by: Dave | last post by:
I have the following ASP.NET 2.0 code (simplified here for ease): <asp:Repeater id="SearchResultsRepeater" runat="server"> <ItemTemplate> <uc:SearchResult ID="SearchResult"...
2
by: archana | last post by:
Hi all, I have created one user control where i want to do fragement caching. what i want is to set value of user control from its containing page. Can i do this? If so how to do this. ...
16
by: PhilippeM | last post by:
I am still very new at this (first timer actually).. I am also trying (with numerous efforts) to create a search box in a form. I have made a dropdown box and a textbox to enter the searchcriteria. I...
3
by: ghjk | last post by:
I have a web page which is used to enter user data. In there I have 4 buttons named as "Submit, Confirm,Edit,Cancel". User should enter data and click "Submit " button. Then I want to display all...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.