 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 25th, 2006, 06:03 AM
|
|
Authorized User
|
|
Join Date: Aug 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
>=[forms]![frmReports]![txtDateFrom] And <=[forms]![frmReports]![txtDateTo]
this is the string i use for the query, so it works if i put it in on of the date fields to query, now if i put it in all the date fields it querys then nothing and show nothing now i had this working yesterday and all of sudden its not working now... i cant understand that as it worked and at least showed me the custmers within the date fields i queried...... man this is proofing to be a pain in the ass
|
|

August 25th, 2006, 07:02 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
Hmmmm... judging from your last two posts, it suspect that your table is not normalized and you're not understanding placement of criteria.
If you have fields such as this Machine01, Machine02, ... , Machine20; and Type01, Type02, ... , Type20; Date01, Date02, ... , Date20, etc. then you're not normalized. You just need one field each called, say strMachine and strType and dtmDate, and another field called bytMachineNo (this one can be set to a number from 1 to 20).
Criteria need only be placed once in a query, not for "all the dates" as you suggested. Not knowing the structure of your table, query, and form will make it hard to solve cleanly... given my suspicions.
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
|
|

August 25th, 2006, 01:19 PM
|
|
Authorized User
|
|
Join Date: Aug 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The thing is each company owning these machines could have upto 20 plus i have to use a combo box thingy with the list of machines, if u dont mind i could send u the file over and u could then get a better idea of what im looking at....
be great if so
|
|

August 25th, 2006, 01:26 PM
|
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
What Greg is saying is that your table structure should look like this:
tblCompany
CompanyID - PK
CompanyName - text
Address1 - text
Address2 - text
etc
tblMachine
MachineID
MachineName - text
etc
tblType
TypeID - PK
TypeName - text
etc
tblJunction
JunctionID - PK
CompanyID - FK (combo box)
MachineID - FK (combo box)
TypeID - FK (combo box) (could also be in Machine table)
iDate - Date
This would allow you do have a company with a million (n number) of machines without having to redesign the table. What if a customer gets their 21st machine? In your design, you redesign the table. In this normalized design, you add another record. Always design for n records.
mmcdonal
|
|

August 26th, 2006, 01:37 AM
|
|
Authorized User
|
|
Join Date: Aug 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Whats PK, FK mean, sorry im very new to access and need maybe complete tuition....
but for all your help its great gives me ideas and then i can try and put something better together
many thanks
|
|

August 26th, 2006, 09:41 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
PK is used to designate a Primary Key, and FK is used to designate a Foreign Key.
In a relational database, you might have a table of employees, and another table with multiple records that would be linked to that employee. In the employee table you would set up a PK field that contains a number (typically an autonumber) and then in the other table, instead of entering the employee name, you just enter the PK associated with them in the FK field. Designing your database like this dramatically decreases the size, and increases the performance of your database.
Hope that helps,
Mike
Mike
EchoVue.com
|
|

August 26th, 2006, 11:29 AM
|
|
Authorized User
|
|
Join Date: Aug 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Helps greatly, thanks
|
|
 |