John,
I made the changes but it still doesn't as me for the record number. This
is my query. SELECT SWTEST.[Record Number], SWTEST.[Sw Version:],
SWTEST.[Tester:], SWTEST.[Reviewed:], SWTEST.[Date:], SWTEST.[Installation
Runs OK], SWTEST.[Program comes up after install], SWTEST.[Main screen comes
onto the display], SWTEST.[Setup selections are stored], SWTEST.[Setup
selections to perform their functions], SWTEST.[Show ECG waves when
selected], SWTEST.[Store ECGs when selected], SWTEST.[Gain settings],
SWTEST.[Lead selections], SWTEST.[Sweep Speed display modes],
SWTEST.[Algorithm selections (filters)], SWTEST.[Retrieve Data Selected],
SWTEST.[Grid on/off], SWTEST.[Condense/non condensed displays], SWTEST.[ECG'S
as Applicable], SWTEST.[Summary as applicable (Screen Test OK)],
SWTEST.[Measurement cursors], SWTEST.[Demographics editing],
SWTEST.[Batch/Telecom], SWTEST.[Batch list editing: adding, clearing,
subtracting and listing fu], SWTEST.[Can check just files], SWTEST.[Database
Deletions], SWTEST.[Menu and Button Coordination], SWTEST.[Mode changes
(Retrieve to ECG, etc], SWTEST.Installed, SWTEST.[Proper Statement for any
test ECG], SWTEST.[Misc:], SWTEST.[Read in OK], SWTEST.[Auto analysis of test
mark R Waves], SWTEST.[Change Beat Code], SWTEST.[Delete Beat],
SWTEST.[Special Test this rev], SWTEST.[Report Printing:], SWTEST.[Holter:],
SWTEST.[Copy Drive to Drive], SWTEST.[Test Date:]
FROM SWTEST
WHERE (((SWTEST.[Record Number])=[enterrecordnumber]));
The code is
Private Sub Command92_Click()
On Error GoTo Err_Command92_Click
Dim strReport As String
strReport = "STF Report"
DoCmd.OpenReport strReport, acViewPreview
Exit_Command92_Click:
Exit Sub
Err_Command92_Click:
MsgBox Err.Description
Resume Exit_Command92_Click
End Sub
Did I put something in wrong. Thank you so much for your help.
Terry
John W. Vinson said:
Sorry I didn't get right back. Had a emergency. Here is the information you
asked for. Thanks for your help.
SELECT SWTEST.ID
FROM SWTEST
WHERE (((SWTEST.ID)=[enter record number]));
This query will return the ID from your table - AND NOTHING ELSE.
If you want the report to print any fields other than the ID, open this query
in design view and add the fields that you want to see to the query grid. The
SQL will be
SELECT SWTEST.ID, SWTEST.thisfield, SWTEST.thatfield
FROM SWTEST
WHERE ... <as above>
Use this stored query as the Recordsource property of your report. I suspect
that currently the report is currently based on the entire table, not on the
query.
Option Compare Database
Private Sub Command92_Click()
On Error GoTo Err_Command92_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection
Exit_Command92_Click:
Exit Sub
Err_Command92_Click:
MsgBox Err.Description
Resume Exit_Command92_Click
End Sub
UGLY old wizard code... don't know why this was never upgraded, but the wizard
is using Access 95 syntax!
Replace this with
Private Sub Command92_Click()
On Error GoTo Err_Command92_Click
Dim strReport As String
strReport = "EnterNameOfYourReportHere"
DoCmd.OpenReport strReport, acViewPreview
Exit_Command92_Click:
Exit Sub
Err_Command92_Click:
MsgBox Err.Description
Resume Exit_Command92_Click
End Sub
You can use acViewNormal if you want the report to print immediately rather
than opening in Preview mode.