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

Help With Query using Form referencing table with group of items

Hopefully the title makes enough sense to get my point across.

Using Access 97 here.

I am trying build a query which uses a form to select the criteria. It works fine if the source contains just one item.
Here is the criteria example:
=([Forms]![frmRETIREMENT_REPORT]![cboUNIT])

Problem is the table I am referencing from cboUNIT is setup into groups and each group contains multiple items. For example GROUP1 is units 4,7 and 8.

I can make the query / form work just fine if cboUNIT is just bound to a table which contains one unit per record, but I need the form to be able to just select my defined groups.

So my question is, is it possible using my example criteria to have cboUNIT be bound to a table with a record that is something like ("Unit 04" or "Unit 07" or "Unit 08")? Please help.
Oct 19 '10 #1
7 1372
nico5038
3,080 Expert 2GB
I would create a new table "tblUnitGroup" with:
UNIT
Group
And thus have rows with:
GROUP1 4
GROUP1 7
GROUP1 8
etc..

Now JOIN this table to the units in the other table and use the combo for filtering the UNITs

Getting the idea ?
Oct 19 '10 #2
Maybe not...how would I in turn use this as the criteria for my query? If I set it up to do just one unit, the query returns exactly what I am looking for on just that one unit. I created the table with groups in an attempt to be able to select multiple units on the form which belong to those assigned groups.

I know I can type into the criteria of the query manually ("Unit 04" or "Unit 07" or "Unit 08"), but I am looking for a way on the form to be able just select GROUP 1 and have it run the query with that criteria....
Oct 19 '10 #3
nico5038
3,080 Expert 2GB
Just create the table and next JOIN this new table in the form's and report's query by the Unit.
In the combo you now select the Group and all joined rows with this Group (and thus Units 4/7/8) will appear in the report.
Expand|Select|Wrap|Line Numbers
  1. =([Forms]![frmRETIREMENT_REPORT]![cboGroup])
  2.  
Oct 19 '10 #4
I guess I'm still not clear what you mean. The table I currently have has the following: a Group Number and the Units contained in that group;

GROUP UNITS
"Group1" "("Unit 04" or "Unit 07" or "Unit 08")"
etc....

I have the form looking at this table. Should I just not be using this table at all? I am just very confused by what you are saying....
Oct 19 '10 #5
nico5038
3,080 Expert 2GB
I was under the impression that the Group wasn't recorded in your table. When your database is fully normalized you would have such a separate Group/Unit table.

When the group is in your table, all needed is to switch the combo from Unit to (Distinct) Group and your query can work on that.

Nico
Oct 19 '10 #6
I realized I need to give more info here. My access database is actually linked to another database. In the other database, the only ID that is on each asset it the Unit and not the group. So you are correct, Group is NOT recorded in a table and for that matter neither is the Unit name in my database. Now, how should I build tables and how many? One for Groups and one for Units? Please help clarify for me. Thanks!
Oct 20 '10 #7
nico5038
3,080 Expert 2GB
I would start with a Group-Unit table as described in my previous comment.
This can be filled with the Unit's from the linked table by using a Groupby query like:
Expand|Select|Wrap|Line Numbers
  1. select Unit from tblLinked Group By Unit;
  2.  
Create this query and change it into an "Append" type that's filling your tblGroupUnit.

Now add manually the Groups the Unit's belong to and phase 1 is ready.

Next JOIN the form and report query with this new table and change the form's combo into a Group selection.

That would be all.

Nico
Thus all unique
Oct 20 '10 #8

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

Similar topics

2
by: sreddy | last post by:
I am trying to write a sql query on self referencing table. Just to brief ..Database is related to a Hiring department of the Qwest company. I need to generate a Report used by in HR...
1
by: Old Timer | last post by:
I wish to type in a number in my "Code" field, for instance 1060, I then wish the number 1060 to trigger an event that will fill in the next field (township field) For instance, 1060 brings up and...
5
by: RBohannon | last post by:
I'm using A2K. I would like to create a form that would allow the user to run a particular query by entering the parameters into one or more text boxes. I am currently using a parameterized...
14
by: Darin | last post by:
I have a table that I want to delete specific records from based on data in other tables. I'm more familiar with Access '97, but am now using 2003, but the database is in 2000 format. In '97, I...
1
by: JNariss | last post by:
Hello, I have created a form called frmS2P with the following: 1 listbox called List11 which holds the contents of a query created off my table called tblRequestActions. The fields which the...
6
by: ljungers | last post by:
Hi to all and hope someone may have an answer for me. I have a Form named Cust_lukup_Form that has 3 text boxes and a click button that uses a OnClick to call Cust_lukup_Macro that runs an...
3
by: DHarris | last post by:
I created a continuous form in Access2003 based on a query that users review customers and once reviewed clicks on a command button that executes an append query to update a table of the reviewed...
11
by: funky | last post by:
hello, I've got a big problem ad i'm not able to resolve it. We have a server running oracle 10g version 10.1.0. We usually use access as front end and connect database tables for data extraction....
1
by: gelpaks | last post by:
My problem is a bit long and involved, but I will try to summarize. I have created a database using Access 2000 for a cemetery and it now is populated with almost 6,000 names. I created a form so...
3
by: bilalkhan | last post by:
Hello I m using MS Acces 2007, I need to create a form through which a user can enter all the parameter values in the form and these values will automatically picked by a query: Here is the...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.