RE: eliminate printing output dialog box
- From: Klatuu <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 3 Nov 2005 10:16:07 -0800
Cant' help with the printer dialog, but here is what you want for the "next
post"
I have a listbox that is used to look up a client by either name or SSN.
Once you select the client you want, you can click the OK command button, you
can press Enter, or you can double click. This, of course, applies to the
currently selected row:
There is one embarresing thing about this code. It was written five years
ago before I knew how to check to see if a form is loaded
Private Sub cmdOK_Click()
On Error GoTo Err_cmdOK_Click
Dim strKeyClt As String
strKeyClt = Me.lstClient.Value
DoCmd.Hourglass True
On Error Resume Next
If gblnDirty Then
[Forms]![frmclientdataentry]![txtLstUpdt] = Now
End If
DoCmd.Close acForm, "frmClientDataEntry", acSaveNo
On Error GoTo Err_cmdOK_Click
DoCmd.OpenForm "frmClientDataEntry", , , , , , strKeyClt
Exit_cmdOK_Click:
Exit Sub
Err_cmdOK_Click:
MsgBox Err.DESCRIPTION
Resume Exit_cmdOK_Click
End Sub
Private Sub lstClient_DblClick(Cancel As Integer)
cmdOK_Click
End Sub
Private Sub lstClient_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
cmdOK_Click
End If
End Sub
"Wendy Farkas" wrote:
> A listbox control on a form displays reports generated from parameter
> queries. Clicking an "Open Report" button prompts the user to enter some
> information, resulting in the appearance of an .rft document. Exciting!
>
> (I want to get to the point where I can eliminate the button and have the
> thing start right from double-clicking the listbox item, but I'll save that
> for another post)
>
> Behind the parameter prompt dialog box there is a Printing message box that
> states "Now outputting blah-blah to the file yah-yah."
>
> My question: how can I eliminate the appearance of that print status box?
> My code:
>
> 'Output the selected report name to a Word file
> Private Sub btnOpenRpt_Click()
> On Error GoTo Err_btnOpenRpt_Click
>
> DoCmd.OutputTo acOutputReport, Me.qmyrpt.Value, acFormatRTF,
> ("C:\Documents and Settings\All Users\Desktop\" & Me.qmyrpt.Value & ".rtf"),
> True
>
> Exit Sub
>
> 'Everything below here is Error handler stuff.
> Err_btnOpenRpt_Click:
>
> 'Trap "Output To action cancelled" error (2501)
> If Err.Number = 2501 Then
> 'Deal with action cancelled problem.
> Dim ErrMsg As String
> ErrMsg = "Report request cancelled."
> MsgBox ErrMsg
> End If
>
> 'Trap "Output To action cancelled" error (2487)
> If Err.Number = 2487 Then
> 'Deal with action cancelled problem.
> ErrMsg = "You must select a report before pressing the button."
> MsgBox ErrMsg
> End If
>
> End Sub
.
- Prev by Date: Re: Generic Password
- Next by Date: RE: a bit of vba, a bit of sql
- Previous by thread: Re: Generic Password
- Next by thread: Re: eliminate printing output dialog box
- Index(es):