Solved

Access 2007 Parameter Question

Posted on 2011-09-02
20
398 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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
 

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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access 2016 7 35
Normalization of a table 19 74
Access 2003 query lost it's only join 7 27
split XML field into many fields from MS Access 21 24
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

773 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