Select criteria based on the field name the user selects

Hi all,

       I am facing with aproblem where in i have a small access db
with forms and reports now i want to change or set the where condition
of a query based on the value the user selects from the form through a
combo box. For ex:- if user is selecting Invoice_date then the where
condition should search based on invoice date if the user selects any
other field the querys where condition should search based on that
particular field.Can any one help me in getting a solution for this.

0
Raj
10/9/2007 9:45:32 AM
access.queries 6343 articles. 1 followers. Follow

1 Replies
805 Views

Similar Articles

[PageSpeed] 33

I have a sample database that shows how you can use various controls to set 
the filter of a query that is then used for report, etc.
http://www.accessmvp.com/KDSnell/SampleDBs.htm#FilterForm

-- 

        Ken Snell
<MS ACCESS MVP>


"Raj" <rajesh.b06@gmail.com> wrote in message 
news:1191923132.665734.184010@v3g2000hsg.googlegroups.com...
> Hi all,
>
>       I am facing with aproblem where in i have a small access db
> with forms and reports now i want to change or set the where condition
> of a query based on the value the user selects from the form through a
> combo box. For ex:- if user is selecting Invoice_date then the where
> condition should search based on invoice date if the user selects any
> other field the querys where condition should search based on that
> particular field.Can any one help me in getting a solution for this.
> 


0
Ken
10/9/2007 12:22:00 PM
Reply:

Similar Artilces:

Items options table name???
I am trying to find the name of the table that holds the "item option" settings. It is located under configuration-->options tab. This is where you check or uncheck configuration settings of the pos software and the folders are called Customer options, General options, Item option, POS options, and so on. Thanks Dave Dave - look in dbo.configuration; there's a couple of entries for "options", but I don't know off the top of my head the specific options tracked. I have not seen a separate table that tracks "options". Hope this helps... "D...

Sorting pivot table by specific field (column)
Hey guys (and girls), Anyone know how to sort a pivot table by a specific field (not the total sum of the fields)? For instance, if I have 5 years of data 2002-6 and 20 countries. If I make a pivot table of these I get 21 rows (the countries + total) and 6 columns for years (5 years of data + total). If I use the Field Settings --> Advanced --> Sort by field the Pivot table (PT) will be sorted by the sum of the different fields. What if I don't want this, but rater want to sort it by for instance year 2003. How do I do that? Anyone have a nice and clever solution? Much appreciated...

Searching emails for a specific domain name
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Power PC Email Client: pop Entourage doesn't seem to allow me to seek an email with a specific domain name. The choice &quot;from&quot; only seems to include a person's name, not their domain site. Why doesn't the &quot;from&quot; feature extend to the domain itself? Thanks for the help! <lindafine@ameritech.net> wrote: > Entourage doesn't seem to allow me to seek an email with a specific > domain name. The choice &quot;from&quot; only seems to include a > ...

Letter Writing Assistant selection based on Smart List Lookup
We had a great opportunity to use the letter writing assistance to send out a notice to any vendor used within the last 6 months. Using the smartlist lookup up we can see those vendors we have issued a check to based on Last Check date, but the Letter Writing Assistant only allows you to select ranges. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the ...

variable field width
I need to display client name and associated address information. There are three rows of data which are taken from the contacts table. The field boxes are all fixed in width, I want to make the width dependant on the data length, and if the field data are short, the boxes would leave no extra white space. I may have several field boxes in a row, and I would like the boxes to go right next to one another without spaces, so each field box position is anchored to the end of the previous field box. How would I implement this? John. John D. wrote: > I need to displ...

Forcing users to click an action button to advance the slide
I am trying to have a PPS that forces users to click an action button to continue. I want to force them to go through each slide vice just quickly hitting keys to jump to the end of the show. I am unsure of what I have to disable to allow this to happen. Hi Slide Show -> Set up show -> Browsed at kiosk will disable all ways of advancing the presentation except for 'buttons' on screen. Lucy -- Lucy Thomson PowerPoint MVP MOS Master Instructor www.aneasiertomorrow.com.au "Azlian" <Azlian@discussions.microsoft.com> wrote in message n...

Sorting in select query. manually
Hello, I have a select query and I would like to sort on the field month. but I want to be able to specify the order myself (not descending nor ascending). how can I do this? thank you! You create a table with the data you which you would see in the Month field and the sort order that you want. You then join these two tables in the query and sort on it. Something like this: Month MonthSort Jan 12 Feb 11 Mar 3 and so on. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycl...

User Access Reporting
Hello Everybody, Does anyone know of a better way to audit security for individual users that the User Security report? Even with the options set to include Accessible Items only, we're finding the report for a single user runs well over 100 pages. With that kind of bulk, both the generation and review of the reports becomes a major endeavor. We're currently using GP9, with plans to go to 10 this year. Thanks, Jeremy Hi Jeremy Have you looked at the Rockton Software add-on called Security Auditor? I think it will do everything you are looking for and more. -- Fliehigh &q...

Excel & Word auto selection from menus
Ok, I'm a keyboarder, not a mouser. I use quick commands like the letter code or arrows on menus to speed along without the grab, aquire, click business. Excel & Word seem to be periodically (not always) automatically selecting menu items based on prior selections if I use arrow selectors. How do I turn this off? I get no help from "Help". Please reply to my e-mail address: legreenwood@hotmail.com. Thanks! Would love to get rid of this nuisance & keep speeding along. ...

select query of parent and child in one row
I have a parent table and a child table one parent has between 1 and 6 children in the child table I wont a query to have the parent and the child in one "row" how do I create that? thanks for helping me Your table structure is not correct for a relational database but this will get you there. This has three but you get the idea and expand on it. Place the table in the design grid as many times as you have field to combine. SELECT MultipleFieldData.x, MultipleFieldData.a & IIf(MultipleFieldData_1.b Is Null,Null," " & MultipleFieldData_1.b) & IIf(MultipleF...

Clause order in SQL select query
Are there any rules that govern clause order? Does the parser care? Obviously SELECT must be first but does WHERE have to precede ORDER BY? This question arises because I have a situation where the VBA code would be easier if the WHERE could be the final clause. That way I could have an unchanging SELECT, FROM, ORDER BY string and just tag the WHERE; on the tail. My thinking then turned to whether there is a mandated order for other clauses too. Is there an article somewhere to explain it? -- Len ______________________________________________________ remove nothing for v...

User forms #4
Rather than linking excel to a VB front end, how powerful are the VB userforms? If I want to create a front end of my excel workbook with sheets which will just display information that the cells calculate th how hard would this be? I also want to try and hide the fact that it is an excel spreadsheet? Thanks in advance Padrai -- Message posted from http://www.ExcelForum.com Shouldn't be too hard, especially if you know VB! To hide the fact the file is in excel you can do things such as hidin worksheets and also hiding toolbars when the worbook_open event i triggered. This can al...

How to Concatenate a variable name in a vba loop ?
Const Value1 as long = 5 Const Value2 as long = 12 Const Value3 as long = 7 For i = 1 to 3 MsgBox Value & i '<-- How to do this properly? Next i I want MsgBox to display 5 then 12 then 7 I can't figgure out how to get Value and i to combine properly to do this. thanks for any help. PS - This is a repost as I didn't ask the question correctly last time. But you are happy with the last answer you got? -- HTH RP (remove nothere from the email address if mailing direct) "tmb" <topmailbox@yahoo.com> wrote in message news:u%d2e.8729$vd.6624@tornad...

Prompt user for filename
I am using the code example from http://support.microsoft.com/kb/161286/ It will open a file dialog for a user to select or type in a filename. It works fine. However when the user types in the name of a file that does not exist like "testfile" it will save it as "testfile". What I need to be able to do is save it as "testfile.txt" instead. I thought it would be as simple as triming the filename and adding ( & ".txt" ) to the end of it but that seems not to be the case. Can you please tell me what I need to do to make it save with the .txt if t...

mass definitions of cell names
Ok, I have a problem. I have to name a large number of cells in different sheets. I'm hoping that there is a way in a macro, or some other way to define these in an easier way other than one by one. Here is an example: 1 2 3 4 1001 --------- --------- --------- --------- 1002 --------- --------- --------- --------- 1209 --------- --------- --------- --------- 1210 --------- --------- --------- --------- This would be the column and row headers for the cells. Below is how the...

Bullets in field not indenting
I have a field in my table tblCourses. One of the fields in that table, a memo field, is memCourseOutcomes. So the table contains the courses we have and that field contains (as suspected :)) the course outcomes but in bullet form. I want to use this table's fields in a report but i want those bullets to show as bullets (indented appropriately). Now in the table design i see there is an option to change the field to "Rich Text" - Is that what im suppose to do? IMO, I would normalize the table structure so you didn't store multiple course outcomes in a si...

onchange with lookup fields
Hi people, I'm trying to create a script using onchange() which would copy one lookup1 field to another lookup2 field. When I'm writing crmform.lookup2name.value = crmform.lookup1name.value nothing happens. But if I'm adding a string "alert(crmform.lookup2name.value)" then I receive ID for lookup1. So, I think mapping between fields has done. But in the web form lookup2 field does not populate. Is somebody know solution? -- Best regards, Alexander Baskakov Hi, how is your exact syntax? crmForm.CFPsomething.value == "somethingmore" Did you use 2 =? Reg...

Outlook Express downloads all email to one family user
I've set up a new PC. All of my Epxress POP3 and SMTP information is entered correctly, and I have entered five email addresses into Express (one Main account and four others) My problem concerns receiving email. When logging into Express, all undelivered email for all five accounts is downloaded to the first account Express opens. For example, there are six pieces of underlivered email this morning -- two addressed to the "Dad" account and four addressed to the "Mom" account. Child 1 opens Express and signs into his account and the six emails are downloaded to the...

Reference field in Distribution Query
Hi there, I am using GP10.0. While using Distribution Query, i have selected "Refrence" (8) as one of column. I expecting "Distribution Refrence" from General Ledger Entry should be populated. But i am not getting it. (It is showing Blank values in Excel. I am sure we are having Distribution Refrence in GL entries) Can you pls. let me know, Is my understanding correct? And also in Distribution Query how we can bring Distribution Refrence from G/L entries? Thanks, Loganathan S Logu, Distributioin reference field is available in GL10001 (GL_TRX_LINE...

Pulling calculated field from subform
I have a person table that is the parent table. I have a child table that has a date, a series of yes/no fields, and a risk category that is a calculated field based on certain combinations of the y/n fields. The y/n fields will be logged monthly by date with some interest in the historical data. I want to transfer the risk category that is associated with the most recent date to a query of the main data set. Example, My main form and report will be laid out similarly: NAME SSN DEMOGRAPHIC DATA RISK CATEGORY (pulled from most recent date below) date c1 c2 c...

BCC field #3
Hi If I put people in the bcc field when the person receives the mail it doesn't say who it is to. Is there a way of doing this? Thanks Shona In message <<c7d4vk$plg$2@ns1.fe.internet.bosch.com>> "SS" <Student.13@uk.bosch.com> did ramble: >If I put people in the bcc field when the person receives the mail it >doesn't say who it is to. Is there a way of doing this? No. You just discovered the whole point of the BCC field. -- Ah, the miracle mile, where value wears a neon sombrero and there's not a single church or library to offend the ...

Size of a user defined type with a byte array?
How do I determine the actual in-memory size of a User Defined type (UDT) with a variable size byte array? i.e. I want to know the size the Type would take if written to a disk file INCLUDING the size of things for which only a pointer is stored. e.g. Type TestType ByteArray() as Byte End Type Dim AVar as TestType Redim AVar.ByteArray(0) Debug.Print LenB(AVar) 'Shows 4 Redim AVar.ByteArray(1000) Debug.Print LenB(AVar) 'Also Shows 4 Thanks RichardF ...

Allowing incoming msgs ONLY from users in Addr. Book
Can Outlook be configured to allow incoming messages ONLY from those users in my Address Book? ...

date/time stamp on user exit
I have a database that logs when a form (RPA) comes into our office. The RPA will go through a few different hands and will have different information entered into the database from each person. How do I get a log of when information is entered and by who? I am a beginner so a detailed explanation would be helpful. Thank you! On Wed, 27 Feb 2008 14:26:00 -0800, Kim <Kim@discussions.microsoft.com> wrote: >I have a database that logs when a form (RPA) comes into our office. The RPA >will go through a few different hands and will have different information >entered into the...

Email templates NEED to allow customized entity fields
How can CRM not allow for customized fields from customized entities to be placed into email templates. If ACT can figure out how to do it, CRM should have it also. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community...