Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a form to open a report to a specified record

Status
Not open for further replies.

gsanders32

Technical User
May 23, 2007
6
US
I would like to use a form to open a single record from a table in a report. I have one table to store all the data, one form to input the data, and one report to view it all. This works great, but over time there will be to many records, so I would like to be able to view just one record at a time

I would like to make a form that would pop-up and let me chose one County out of 15 and then let me chose a state well number that matches the county. After I make the sections I would like the report that I already made to open with just that record. Or if I leave the form blank, have all the records show in the report.

If some could point me in the right direction I would be very grateful.
 
I've used the following on a click event, this should help, it only pick up one student and select that student's report only.

Private Sub cmdWarning_Click()
On Error GoTo Err_cmdWarning_Click

Dim stDocName As String


DoCmd.OpenReport "rptWarning", acPreview, , "[STDNO]=" & [STDNO]

Exit_cmdWarning_Click:
Exit Sub

Err_cmdWarning_Click:
MsgBox Err.Description
Resume Exit_cmdWarning_Click

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top