How to select fields using either query criteria or a macro

I have created a database which logs operational data for an industrial water 
plant.  

I want to output a table of the data, based on inputs from the user.  I've 
created a form where the user can enter a date range for the data they want 
to view, and a series of check boxes which correspond with the fields in the 
underlying table.  

In order to restrict the output data to the date range and fields required 
by the database user, I have created a query. My problem is that I can't seem 
to find a way to link the check boxes on my form to the 'show' checkbox in 
the query.  I have tried to create a macro with a conditional expression, ie 
if the form checkbox is 'true', then set the query 'show' checkbox to 'true', 
but this did not work.  

Any advice would be appreciated.

Angela
0
Utf
6/19/2007 6:16:01 AM
access.queries 6343 articles. 1 followers. Follow

1 Replies
704 Views

Similar Articles

[PageSpeed] 39

You cannot link the check boxes on your form to the Show row in query 
design.

If you are comfortable with writing VBA code, it is possible to build a SQL 
statement based on the fields you checked. You could then assign the string 
to the SQL property of the QueryDef.

We can't tell from here, but it may be that using a relational design would 
solve the problem. If you have scores of fields, it may be that you need to 
use 3 tables. For example, if you were storing client health info, and you 
had fields for the diseases the person has had (e.g. fields for ClientName, 
Malaria, Chicken pox, Measles, ...) breaking the table into 3 tables would 
be the best solution. If you want to research that further, search for 
Normalization. Here's a starting point:
    http://www.accessmvp.com/JConrad/accessjunkie/resources.html#DatabaseDesign101

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"AngelaA" <AngelaA@discussions.microsoft.com> wrote in message
news:5CE84CEC-EF66-4042-A435-6058F5B3D9DE@microsoft.com...
>I have created a database which logs operational data for an industrial 
>water
> plant.
>
> I want to output a table of the data, based on inputs from the user.  I've
> created a form where the user can enter a date range for the data they 
> want
> to view, and a series of check boxes which correspond with the fields in 
> the
> underlying table.
>
> In order to restrict the output data to the date range and fields required
> by the database user, I have created a query. My problem is that I can't 
> seem
> to find a way to link the check boxes on my form to the 'show' checkbox in
> the query.  I have tried to create a macro with a conditional expression, 
> ie
> if the form checkbox is 'true', then set the query 'show' checkbox to 
> 'true',
> but this did not work.
>
> Any advice would be appreciated.
>
> Angela 

0
Allen
6/19/2007 6:55:46 AM
Reply:

Similar Artilces:

Query-based list w/1 Exception
I've created a query based distribtuion list which works fine yet out of the 1000 or so mailboxes it gives me I'd like to exclude 10. Is there a way? (Basically I have checked only "Users with Exchange mailbox") Make those 10 recipients members of a distribution group, and add the following to the query: (&(your current query)(!memberOf=distinguished Name of the distribution group)) Alternatively, if there's a common value of a particular attribute like location/city/department, et al, use that to exclude them. -- Bharat Suneja MVP - Exchange www.zenprise.com ...

how can I close a UserForm using a shortcut key ?
This is a multi-part message in MIME format. ------=_NextPart_000_0011_01C4D528.49737CD0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable How can I close a UserForm using a shortcut key ? T. I. A. ------=_NextPart_000_0011_01C4D528.49737CD0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1">...

Run report on multi selected records.
I try to make a report for a custom entity that works like the Account Summary: let's say that it's Customer's Inquiry Summary for entity Customer's Inquiry I made the report so that I'm able to run the report on Customer's Inquiry Form. But when I select multi records in the list of Customer's Inquiry and run report, only one record is show in one page of the the report. I would like to have the selected records appear in the report with each record on each page. How can I do this? ...

Combo box list selection based on earlier selection by user
HI, I have a form that has a combo box 1 (Product) that reads a the Product table and has a unique id attached to each product (RO#). There is a second combo box 2 that is RO#. Now what I would like to do is when a user selects a Product in combo box 1, the system should lookup the Product selected from combo box 1 and upload the corresponding RO# in the combo box 2 list. Now I am using both combo boxes as Unbound and in the combo box 2 I have the two columns Product and RO# - in the Criteria row of RO# I have the following: Like IIf([Forms]![xa_f_lookup]![RO#]=" ",[Forms]![x...

When shading cells using the 'pattern' option, they print in grey.
When trying to print a 'pattern' in cell shading, it prints only as grey-scale solids. Do the patterns not print, or is it "averaging" the pattern into a solid? Printer dpi is 600, and appears as a pattern on Preview. ...

serialization when using reflexion
Hello, My application needs to serialize a class, which was generated with xsd.exe from a XSD. It was working .NET 1.1 and it is working with .NET 2.0 very well. Now I need my assembly to be a plugin, and to be called by reflexion, but I get this Exception: Exception.Message: "There was an error generating the XML document." Exception.InnerException.Message: "Unable to cast object of type 'NMI.STARTi.EDI.Ingram.OrderRequest' to type 'NMI.STARTi.EDI.Ingram.OrderRequest'." The method I'm calling is static (I tried non-static as well) and the class ...

Can't select objects in Excel 2007
I'm trying to create a form in Excel 2007, and although I can manipulate, copy & paste controls (check boxes, etc) I can't select multiple objects to align them, etc. I've checked on-line help (and have followed the instructions), and other websites, but no one seems to have indicated a problem. It is extremely cumbersome and I need a solution. Any ideas? Thanks in advance, Jim Berglund I know this is about a year too late, but it may help others who have stumbled across this page looking for similar help. On the Home tab, in the Editing group, click Find & Select....

Using Custom Views
Complete Excel noob here - If I've defined a custom view in one workbook, how can I apply it to another. It is not shown in the list. What I want to do: I have a workbook with columnar data similar to a check register. I have set up the formatting for display and print formatting, including headers & footers. This data is for a specific client but I want to save that formatting, both visual and print so that I can create new workbooks for other clients and apply the same formatting. I thought that by saving the custom view it would work but it is not seen outside of the workbo...

Report using Organization Chart from HierarchyID
Anyone with an example of creating an organization chart using HierarchyID? I have created the hierarchial nodes such as / /1/ /1/1/ /2/ /2/1/ /3/ Is there any way of generating an organization chart easily, where the root is /? search the web. good examples abound, especially from itzik ben-gan. SELECT hid, hid.ToString() AS path, lvl, empid, empname, salary FROM dbo.Employees ORDER BY hid; -- Kevin G. Boles Indicium Resources, Inc. SQL Server MVP kgboles a earthlink dt net "Gum" <gum@nospam.nospam> wrote in message news:3B150CBE-D8...

how do I use Microsoft Ooutlook with Yahoo Mail
I use Microsoft Outlook. How do I use Yahoo Mail with the M/O. I do all it says and I still cannot get it to work. Debby Townsend wrote: > I use Microsoft Outlook. How do I use Yahoo Mail with the M/O. I do > all it says and I still cannot get it to work. Unless you have a paid account , or use yahoo UK then you can't. Thank you Gordon. I live in Totola, British Virgin Islands so will need to go into Cable and Wireless to find out what the ISP address is. But how come you can use Outlook Express with an account like Hotmail? Thanks again Debby "Gordon" wrote: &g...

Lot Selection not Showing when I select PO on Receiving Entry
Usually, the Lot selection screen would pop up when I select a PO at the Line Detail of the Receivings Entry, now it does not! And GP will let items post without a lot number! It seems as if a setting has changed. Any ideas anyone? Any help is appreciated. Thanks, R Are you sure the item is marked to track lots? This wiould be set item by item on the Item Maintenance Options window. -- Richard L. Whaley Author / Consultant / MVP 2006-2008 Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com &q...

filling a control in a continuous form with a field from a table
I had posted this under "Access Reports" in error and received a response and responded. Please follow the dialog for an explaination of my question: Original Question: I have a form with the fields: date, client, atty, time, billable and description. All these fields update the Time Sheet Table. I want the atty field to automatically take the attorney's name from the table Attorney which contains one field called Atty. So for I can only figure out how to use a combo box to chose the Attorney table field. Response Received: Your combo box to select the at...

How to use MSGP login to authenticate user?
Hi, i have a question and hope someone might be able to answer. i'm writing a program that using MSGP login to authenticate my users. As i know, MSGP store the encrypted password, my program was unable to match the username and password. Is there any way to decrypt the password? thanks. BC no "BC" <anonymous@discussions.microsoft.com> wrote in message news:53b301c49163$187c84e0$a501280a@phx.gbl... > Hi, i have a question and hope someone might be able to > answer. > i'm writing a program that using MSGP login to > authenticate my users. As i know, MSG...

Select contact then hangs
Hi, please help. I have a user that when she selects a contact using To: in a new email, after selecting 2, it closes outlook??. Spec is W2kSP4\office2k with all windows updates and office updates installed. Profile has been deleted and re-created, plus i have set up personal folders and moved contacts into there, and set that folder as a default, but makes no difference. Please help. ...

Selecting rows from various sheets
Hi all, I have several sheets with a few columns in each. One colum in each sheet has a unique value. Most of these unique values are th same in each sheet but not all. Is there any way that I can set up new sheet that will have the unique value in column 1 and th corresponding column values frommeach sheet beside it. For example Sheet 1 aa 1 1 1 bb 2 2 2 cc 3 3 3 Sheet 2 aa 4 4 cc 5 5 Result aa 1 1 1 4 4 bb 2 2 2 cc 3 3 3 5 5 Thanks alot, Sha -- sha ----------------------------------------------------------------------- shav's Profile: http...

Field list not showing up
Excel 2007...no matter what I do the field list does not show up. when I select hide the pivot table frame goes blank, when I unhide I get the basic table verbiage, but no field list. Any thoughts? Actually when I go to fullpage view I can get the field list, but in normal view cannot get the field list to appear. driving me nuts. "JeffVA" wrote: > Excel 2007...no matter what I do the field list does not show up. when I > select hide the pivot table frame goes blank, when I unhide I get the basic > table verbiage, but no field list. > > Any thoughts? ...

select text in Calendar
I'm working on a calendar in Publisher. I'm adding text into a cell by spacing down 1 point, then typing in 8 points. Doing fine until April. At that time, I can only select cells (whole days). It will not let me select the text. Help is no help. Any hints out there. Did I accidentally select something to do this? Bonnie Have you added a picture to the cell or a shape? If you have send it to the back, make the cell no fill and try again. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "GoBonnieGo" <GoB...

macro to filter data based on selected data
Hi, I am looking for a macro that requests input of a reference code and then a date and then filters the data in my spreadsheet based on this criteria. I am using excel 2007. Any help with this will be greatly appreciated. You can probably record a macro while doing it manually and then clean it up and add input boxes to ask the question or input your variable in a cell and use that. If all else fails, If desired, send your file to my address below. I will only look if: 1. You send a copy of this message on an inserted sheet 2. You give me the newsgroup and the ...

Auto Fill Macro Not Working Properly
Hi, I used a macro that I found through this newsgroup that auto fills down when you've got spaces in Column A that need filling with a prior value. It looks like this. Sub FillBlanksColumnA() Application.ScreenUpdating = False Extent = Cells.Rows.Count For i = 2 To Extent If Cells(i, 1) = "" Then Cells(i, 1) = Cells(i - 1, 1) Next i End Sub My problem is that this continues onto line 65000+. How can I revise this macro to stop when there is a blank or no value in Col B? Or can it be revised to say stop at line 2000? Thanks in advance. Jason Jason, If you want...

Link select with a blast
I have Win 7 Home Premium, x64. Quite often, when I select a link, a mouse pointer changes to a palm with a blast. I understand, the palm is the standard mouse pointer for link select, but what is the blast? What it indicates? -- Ilya Zeldes Fort Myers, Florida Hi Ilya, I suspect that this is being caused by a tracking program. Run something like Ad-Aware and see if it indicates a tracking company. If so, you can delete it, however, it might prevent you from accessing that particular website. Dave "Ilya Zeldes" wrote in message news:7A6FF9B1-5512-44...

Can I use automatic dialing in Outlook if I use a cable modem?
http://dts-l.org/goodpost.htm -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. "salsanstyx" <salsanstyx@discussions.microsoft.com> wrote in message news:85FF5912-B7DA-4E40-9AC6-943A3E9538CF@microsoft.com... | as long as you have a phone line connected to the computer, yes. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tas...

Defaulting fields
I have a complex circle of information. Here is what I need: Create new record table1 from form "initial" Create new record table2 from form "progress" with fields 1,2,3 defaulted from last "initial" record Create new record table3 from form "plan" with same fields defaulted from last record from "progress" Create new record "progress" defaulted fields from "plan" Create new record "progress" defaulted fields from latest fields from either "progress" or "plan" Basically I need fiel...

Select Case in a Change Event
Hi, I am trying to use a worksheet Change Event to trap changes to specific columns. depending on which column is chnaged by the user, the value in another ciolumn will be altered; so, changes in either column O or P will update column Q, changes in either column T or U will update column V and changes in column Z or AA will update column AB. What I can't figure out is the Select Case bit (where I've got the shouted question below). Here's what I've put together, any comments would be much appreciated. Private Sub Worksheet_Change(ByVal Target As Range) ...

Select Records based another table...
This may be very elementary, but i can't wrap my brain around it. I have tried to dummy it down as much as i can for myself, with plans of adapting it into something working. I have three tables that look like the following: Tbl 1: ProdID A B C 1 $1 $2 $3 2 $4 $5 $6 3 $7 $8 $9 Tbl 2: RmNum ProdID 1 3 1 2 2 1 2 2 Tbl 3: RmNum Style 1 A 2 C Relationships are: [tbl1 ProdID] ------ [tbl2 ProdID] [tbl2 RmNum] ...

How do delete Hidden Macros and excel links
Hi, I was wondering if anybody knew of an add-in that would delete hidden macros or excel links. I remember there being one but forgot where to download it for free. Thanks. Hi LT! To remove all code from a workbook: Chip Pearson: http://www.cpearson.com/excel/vbe.htm You need to look for the heading: "Deleting All VBA Code In A Project " To remove links you can use freely downloadable Addin FindLink from: Steve Bullen hosted: http://www.bmsltd.ie/DLCount/DLCount.asp?file=FindLink.zip -- Regards Norman Harker MVP (Excel) Sydney, Australia njharker@optusnet.com.au Excel...