Solved

Access 2007 Parameter Question

Posted on 2011-09-02
20
379 Views
Last Modified: 2012-08-14
I have attached a copy of my database I created.  The parameter query for Driver License Number is pulling duplicate records.  When I enter the Driver License Number for example, "875442116" I am getting 12 records.  I want only the three records for Vehicles, and 4 records for Weapons to show ad have the Point of Interst record show one time and the ciontct one time.  There shouldbe only 7 records to show in lieu of 12.

Am I doing something wrong with the parameter query?  I believe I have duplicate records being pulled.
jjc9809
0
Comment
Question by:jjc9809
20 Comments
 
LVL 6

Expert Comment

by:c1nmo
ID: 36476545
Multiple joins in query?

Please forward query SQL or db?
0
 

Author Comment

by:jjc9809
ID: 36476582
SELECT DL.PK_DriverLicenseID, DL.IssuingState_vch, DL.Priority_vch, 
DL.FirstName_vch, DL.MiddleInitial_vch, DL.LastName_vch, DL.PK_SuffixID_vch, 
DL.PhysicalAddress1_vch, DL.PhysicalAddress2_vch, DL.PhysicalCity_vch, 
DL.SSN, DL.DOB, DL.FK_CountyID_ch, DL.FK_PhysicalState_vch, DL.PhysicalZip_ch, 
DL.DOBMonth_vch, DL.DOBDay_vch, DL.DOBYear_vch, DL.SSN1_vch, DL.SSN2_vch, 
DL.SSN3_vch, DL.FK_RaceID_vch, DL.HeightFt_ch, DL.HeightIn_ch, DL.Weight_ch, 
DL.FK_HairColor_vch, DL.FK_EyeColor_vch, DL.HomePhone1_ch, DL.HomePhone2_ch, 
DL.HomePhone3_ch, DL.MobilePhone1_ch, DL.MobilePhone2_ch, DL.MobilePhone3_ch, 
DL.OtherPhone1_ch, DL.OtherPhone2_ch, DL.OtherPhone3_ch, DL.FBINumber_vch, 
DL.Alias1, DL.Alias2, DL.Alias3, DL.Alias4, DL.Alias5, 
DL.FK_IntelligenceType_vch, DL.FirstContactMonth, DL.FirstContactDay, 
DL.FirstContactYear, DL.FK_DriverLicenseID, DL.ContactMonth, DL.ContactDay, 
DL.ContactYear, DL.ContactAgent_vch, DL.ContactAddress1_vch, DL.ContactAddress2_vch, 
DL.ContactCity_vch, DL.FK_State_vch, DL.ABCCaseNumber_vch, DL.Violent_vch, 
DL.Armed_vch, DL.ArrestingAgency_vch, DL.ProbationOfficer_vch, DL.ParoleOfficer_vch, 
DL.KnownAreas_vch, DL.KnownAssociates_vch, DL.Notes_vch, 
WT.PK_WeaponsID_int, WT.FK_DriverLicenseID_vch, WT.Make_vch, WT.Model_vch, 
WT.Caliber_vch, WT.SerialNumber_vch, VT.PK_VehicleID_int, VT.FK_DriverLicenseID_vch, 
VT.Year_vch, VT.Make_vch, VT.Model_vch, VT.Color_vch, VT.VIN_vch, VT.Tag_vch
FROM (IntelligenceHistorySearch_DriverLicense_qry As DL LEFT JOIN Vehicles_tbl As VT ON DL.PK_DriverLicenseID = VTFK_DriverLicenseID_vch) 
LEFT JOIN Weapons_tbl As W ON DL.PK_DriverLicenseID = WT.FK_DriverLicenseID_vch;

Open in new window

0
 

Author Comment

by:jjc9809
ID: 36476662
I am sending database too.

jjc9809
0
 
LVL 6

Expert Comment

by:c1nmo
ID: 36477144
This is as expected as you are joining both vehicles and weapons on the unique license key, you are getting the number of permutations

1 license x 3 vehicles x 4 weapons
0
 

Author Comment

by:jjc9809
ID: 36477766
AFter I enter the License Number in the Parameter Box, I want the Liccense to show with the contact Info with 3 vehicles and 4 weapons.  There are 12 records showing.   Now there can be multiple contact records made for each License Number.
0
 

Author Comment

by:jjc9809
ID: 36477790
THe database will not sned to you guys.  Is there a problem with the upload?
0
 
LVL 14

Expert Comment

by:pteranodon72
ID: 36477794
What do you want to do with these records? View on screen? Edit? Print a report? In each case, you'd want to make a Master Form/Report based on Driver License and a subform/subreport for vehicles and a subform/subreport for weapons.

The master form's record source would only contain info from the DL (once), there the vehicle subform would show three records associated with the DriverLicenseID, and the weapon subform would show four records associated with the DriverLicenseID.

Use the wizard to make an autoforms for your Driver License table/query. Use it also to make datasheet style forms for the vehicle table and the weapon table. Then insert a subform control to the main form, specify the vehicle form as the source, and specify
LinkMasterFields = PK_DriverLicenseID
LinkChildFields = FK_DriverLicenseID_vch

Repeat for the Weapons subform.

You can substitute the word "report" for any time I used "form" above, if that is your goal.

HTH,
pT72
0
 

Author Comment

by:jjc9809
ID: 36477899
The Parameter Query will pull records for the user to see on the screen when the DL is entered.  I do not want to print or edit any records here.  The subforms is what I want to see here for vehicles and weapons, but I do not know how to set them up.

Do you have a sample I can follow?

I have forms that enter records for Vehicles and Weapons.  I also have forms for data entry of the point of Interest and contact.  There will benly one entry for Point of Interest.  But, there can be multiple contact etries, Vehicle entries, and weapon entries.

I am new to Access.  So I do not know much.

Any help is appreciated.

jjc9809
0
 

Author Comment

by:jjc9809
ID: 36477903
I can't send my database.  It won't upload.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:jjc9809
ID: 36477907
I see only Uploading Please wait, but nothing uploads.  I waited thirty minutes last night and came back and nothing uploaded.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 36477995
do a compact and repair of the db, if  the size is still big, zipped it and upload the zipped file
0
 
LVL 6

Expert Comment

by:c1nmo
ID: 36478306
Something similar to this?

dl person 1 dl person 2
0
 

Author Comment

by:jjc9809
ID: 36478448
ClnMO,

This  is what I am looking for.  When a DL is entered I want to pull all information on a subject such as the Point
of Interest information and contact files on them as well as all weapons and vehicles this subject has associated with the DL.  A law enfrocement agency is going to use this to pull information quickly to find out information on a subject.

Do you have a sample I can use with Parameter entered to pull data and have the sub forms for vehicles and weapons as you have shown.   You can make up information.  I just really want a parameter query so I can get

the data for the sub forms and the main forms.

I will try to zip the database and see if it will send.

jjc9809
0
 

Author Comment

by:jjc9809
ID: 36478544
database sent
0
 
LVL 6

Expert Comment

by:c1nmo
ID: 36478595
test db attached, run form DLs

 Database4.accdb
0
 

Author Comment

by:jjc9809
ID: 36478949
C1nMo,

This looks and works great.  However, I have one question on the DL   The DL has a Data Type set as Number or numeric.  Can the DL data Type be set to Text to accept Alphabetic and Numeric characters?  I believe the Driver License Number in some states have alphabetic characters in them.  So, I need to be able to enter 678987F and find the records.

jjc9809
0
 
LVL 6

Accepted Solution

by:
c1nmo earned 500 total points
ID: 36479017
dl change to text, copy attached

 Database4.accdb
0
 

Author Closing Comment

by:jjc9809
ID: 36479210
Works very well!

Thank you.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now