Making it only display what I want in the Report

  • Thread starter Thread starter seanbenham
  • Start date Start date
S

seanbenham

Guest
I have currently finished doing a databse for a truck repair buisness. I have a job history form with the rego number and a subform in datasheet form of what has been done with that Rego Number using queries. Now what i would like to be done is when they click on the report, all i want them to do is to type the number plate in and all the job history done on that vehicle will be put in that report to print...

Plz help me out guys...
:confused:

Sean
 
Sounds like you need to filter the report. Create a Public Variable called strRegNo. Then either pull the RegNo from a list of them in a select from dialog form e.g.

[Reg].SetFocus
strSearch = [RegNo].Value

or use an InputBox e.g.

strRegNo - inputbox$("What is the Reg No.") You may need a inoput check routine if you use this method for blanks and typos. Hence I prefer a select from Dialog form.

Then

DoCmd.OpenReport "R-Print Report", acViewPreview, , "[RegNo] = '" & strSearch & "'"
 
Nice, I havent done many Public Variable's in my lift so how would i do them, is it via the visual basic editior?????
 
Create a New Module - call it modPublic Variables
One line of Code

Public strRegNo as String

Close and Save
 

Users who are viewing this thread

Back
Top Bottom