Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Access 2007 Parameter Question

Posted on 2011-09-02
20
405 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

839 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