Launching report from Switchboard launches Fax Wizard?

G

Guest

Hello,

I have a command button on the switchboard with the following code to launch
a report:

Private Sub CommandLastXGames_Click()
DoCmd.OpenReport "rLastXGames", acViewNormal
End Sub

The report is based on a query that has the following code:

SELECT t.gamenum, t.gamedate, O.teamname, t.atbats, t.hits,
IIf(t.atbats<>0,t.hits/t.atbats,0) AS BA, t.runs, t.doubles, t.triples,
t.homeruns, t.rbi, t.walks, t.strikeouts, t.LOB, t.sb, t.errors
FROM tGameStats AS t LEFT JOIN tOpponentTeam AS O ON t.teamopponent =
O.teamnumber
WHERE (((t.gamenum)>=DMax("gamenum","tGameStats")-[XGames]));

If I open the report directly from the database, it prompts me as expected
and opens up fine. When I try click on the command button to open the
report, it launches the Fax Wizard? This is a laptop not connected to any
sort of network printer. The Fax printer is set as the Default Printer, but
it doesn't matter when I launch the report directly. Why is it an issue when
I try to launch the report from the Switchboard?

Thanks.
 
B

Bamar

Hello,

I have a command button on the switchboard with the following code to launch
a report:

Private Sub CommandLastXGames_Click()
DoCmd.OpenReport "rLastXGames", acViewNormal
End Sub

The report is based on a query that has the following code:

SELECT t.gamenum, t.gamedate, O.teamname, t.atbats, t.hits,
IIf(t.atbats<>0,t.hits/t.atbats,0) AS BA, t.runs, t.doubles, t.triples,
t.homeruns, t.rbi, t.walks, t.strikeouts, t.LOB, t.sb, t.errors
FROM tGameStats AS t LEFT JOIN tOpponentTeam AS O ON t.teamopponent =
O.teamnumber
WHERE (((t.gamenum)>=DMax("gamenum","tGameStats")-[XGames]));

If I open the report directly from the database, it prompts me as expected
and opens up fine. When I try click on the command button to open the
report, it launches the Fax Wizard? This is a laptop not connected to any
sort of network printer. The Fax printer is set as the Default Printer, but
it doesn't matter when I launch the report directly. Why is it an issue when
I try to launch the report from the Switchboard?

Thanks.

Everything Fine I think,
Problem is your button code click. please changed to acViewPreview
not acViewNormal
acViewNormal is command for printing that report. you just want to
preview it.

Private Sub CommandLastXGames_Click()
DoCmd.OpenReport "rLastXGames", acViewPreview
End Sub
 
G

Guest

Rock on, thank you!
--
Pat Dools


Bamar said:
Hello,

I have a command button on the switchboard with the following code to launch
a report:

Private Sub CommandLastXGames_Click()
DoCmd.OpenReport "rLastXGames", acViewNormal
End Sub

The report is based on a query that has the following code:

SELECT t.gamenum, t.gamedate, O.teamname, t.atbats, t.hits,
IIf(t.atbats<>0,t.hits/t.atbats,0) AS BA, t.runs, t.doubles, t.triples,
t.homeruns, t.rbi, t.walks, t.strikeouts, t.LOB, t.sb, t.errors
FROM tGameStats AS t LEFT JOIN tOpponentTeam AS O ON t.teamopponent =
O.teamnumber
WHERE (((t.gamenum)>=DMax("gamenum","tGameStats")-[XGames]));

If I open the report directly from the database, it prompts me as expected
and opens up fine. When I try click on the command button to open the
report, it launches the Fax Wizard? This is a laptop not connected to any
sort of network printer. The Fax printer is set as the Default Printer, but
it doesn't matter when I launch the report directly. Why is it an issue when
I try to launch the report from the Switchboard?

Thanks.

Everything Fine I think,
Problem is your button code click. please changed to acViewPreview
not acViewNormal
acViewNormal is command for printing that report. you just want to
preview it.

Private Sub CommandLastXGames_Click()
DoCmd.OpenReport "rLastXGames", acViewPreview
End Sub
 
Top