• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 431
  • Last Modified:

Access 2007 Parameter Question

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
jjc9809
Asked:
jjc9809
1 Solution
 
c1nmoCommented:
Multiple joins in query?

Please forward query SQL or db?
0
 
jjc9809Author Commented:
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
 
jjc9809Author Commented:
I am sending database too.

jjc9809
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
c1nmoCommented:
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
 
jjc9809Author Commented:
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
 
jjc9809Author Commented:
THe database will not sned to you guys.  Is there a problem with the upload?
0
 
pteranodon72Commented:
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
 
jjc9809Author Commented:
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
 
jjc9809Author Commented:
I can't send my database.  It won't upload.
0
 
jjc9809Author Commented:
I see only Uploading Please wait, but nothing uploads.  I waited thirty minutes last night and came back and nothing uploaded.
0
 
Rey Obrero (Capricorn1)Commented:
do a compact and repair of the db, if  the size is still big, zipped it and upload the zipped file
0
 
c1nmoCommented:
Something similar to this?

dl person 1 dl person 2
0
 
jjc9809Author Commented:
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
 
jjc9809Author Commented:
database sent
0
 
c1nmoCommented:
test db attached, run form DLs

 Database4.accdb
0
 
jjc9809Author Commented:
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
 
c1nmoCommented:
dl change to text, copy attached

 Database4.accdb
0
 
jjc9809Author Commented:
Works very well!

Thank you.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now