Fax annoyance

G

Guest

When I open my report and then right mouse to get to print then go to fax by
the time I get to the fax I have forgotten the number the report needs to be
faxed to and unlike word it doesn't search for a phone number and fill in the
box. SO, I have created a form that comes up the same time as the report with
the fax number focused so I can copy and paste. BUT, it is not getting the
same filtered information as the report. Can someone tell me how to call the
form at the same time as the report WITH the same filtered info? Both the
report and the faxform are based on the same qry.
I tried below but it doesn't filter properly. I also tried with the filter
below the form again but it doesn't work either. By the way is there any way
to have this trigger only IF someone goes to the fax option in the windows
drop down?
The cmd button is on the OrderWDetails form...
Thanx!!

Private Sub cmdPrevEstimate_Click()
On Error GoTo Err_cmdPrevEstimate_Click

DoCmd.OpenReport "rptEstimateHUPA", acPreview
Reports![rptEstimateHUPA].Filter = "OrderID = " & Me![OrderID]
Reports![rptEstimateHUPA].FilterOn = True
DoCmd.RunCommand acCmdZoom100
DoCmd.MoveSize 1, 1, 13000, 9100
DoCmd.OpenForm "f_Supplierfax"
Exit_cmdPrevEstimate_Click:
Exit Sub

Err_cmdPrevEstimate_Click:
MsgBox err.Description
Resume Exit_cmdPrevEstimate_Click

End Sub
 
A

Arvin Meyer [MVP]

Here's some code posted 5 or 6 years ago with some modifications by me which
works with WinFax. I haven't tested it since then on newer versions of
Access WinFax or Windows:

Function SendWinFax(strFaxNumber As String, _
strReport As String, _
Optional strName As String, _
Optional blnLocal As Boolean = False, _
Optional intDelay As Integer = 0, _
Optional strPrefix As String, _
Optional strSuffix As String, _
Optional strCntryCode As String = "1", _
Optional strFilter As String)

On Error GoTo Error_Handler

Dim objFax As Object
Dim strAC As String
Dim strFax As String
Dim strDate As String
Dim strTime As String

DoCmd.SetWarnings False

Set objFax = CreateObject("WinFax.SDKSend")

If Len(strPrefix) > 0 Then strPrefix = strPrefix & ","
If Len(strSuffix) > 0 Then strSuffix = ",," & strSuffix

If blnLocal Then
strFax = strPrefix & Mid(strFaxNumber, 4, 7) & strSuffix
Else
strFax = strPrefix & strCntryCode & strFaxNumber & strSuffix
End If

strDate = CStr(Date)
strTime = Format(DateAdd("h", intDelay, Time), "hh:nn:ss")

If Val(Left(strTime, 2)) < Val(Left(Time, 2)) _
Then strDate = CStr(Date + 1)

With objFax
.SetDate (strDate)
.SetTime (strTime)
.SetNumber (strFax)
.SetTo (strName)
.AddRecipient
.SetPrintFromApp (1)
.Send (1)
Do While .IsReadyToPrint = 0
DoEvents
Loop

DoCmd.OpenReport strReport, acViewNormal, , strFilter

Delay (0.2)
.Done
Delay (0.2)

End With
Set objFax = Nothing

DoCmd.SetWarnings True

Exit_Here:
DoCmd.SetWarnings True
Exit Function

Error_Handler:
DoCmd.SetWarnings True
MsgBox Err.Number & ": " & Err.Description
Resume Exit_Here

End Function

Public Function Delay(dblInterval As Double)
'----------------------------------------------
' Name: Delay
' Purpose: Generic delay code
' Inputs: dblInterval As Double
' Author: Arvin Meyer
' Date: January 2, 1999
' Comment:
'----------------------------------------------
On Error GoTo Err_Delay
Dim Timer1 As Double
Dim Timer2 As Double

Timer1 = Timer()
Do Until Timer2 >= Timer1 + dblInterval
DoEvents
Timer2 = Timer()
Loop

Exit_Delay:
Exit Function

Err_Delay:
Select Case Err

Case Else
MsgBox Err.Description
Resume Exit_Delay
End Select

End Function


--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

lmv said:
When I open my report and then right mouse to get to print then go to fax
by
the time I get to the fax I have forgotten the number the report needs to
be
faxed to and unlike word it doesn't search for a phone number and fill in
the
box. SO, I have created a form that comes up the same time as the report
with
the fax number focused so I can copy and paste. BUT, it is not getting the
same filtered information as the report. Can someone tell me how to call
the
form at the same time as the report WITH the same filtered info? Both the
report and the faxform are based on the same qry.
I tried below but it doesn't filter properly. I also tried with the filter
below the form again but it doesn't work either. By the way is there any
way
to have this trigger only IF someone goes to the fax option in the windows
drop down?
The cmd button is on the OrderWDetails form...
Thanx!!

Private Sub cmdPrevEstimate_Click()
On Error GoTo Err_cmdPrevEstimate_Click

DoCmd.OpenReport "rptEstimateHUPA", acPreview
Reports![rptEstimateHUPA].Filter = "OrderID = " & Me![OrderID]
Reports![rptEstimateHUPA].FilterOn = True
DoCmd.RunCommand acCmdZoom100
DoCmd.MoveSize 1, 1, 13000, 9100
DoCmd.OpenForm "f_Supplierfax"
Exit_cmdPrevEstimate_Click:
Exit Sub

Err_cmdPrevEstimate_Click:
MsgBox err.Description
Resume Exit_cmdPrevEstimate_Click

End Sub
 
G

Guest

Thanks my VBA is too basic to understand how to use this and since "if"
(which I don't know how to determine) I have winfax I don't know what to do
to change the code to work with XP and for the moment I just need to be able
to get the form to filter to the same info as my report. Maybe later I can
figure out how to apply what you gave me to XP...

If you can point me to some additional information in how to use the code
I'd appreciate the direction.
Thanks


Arvin Meyer said:
Here's some code posted 5 or 6 years ago with some modifications by me which
works with WinFax. I haven't tested it since then on newer versions of
Access WinFax or Windows:

Function SendWinFax(strFaxNumber As String, _
strReport As String, _
Optional strName As String, _
Optional blnLocal As Boolean = False, _
Optional intDelay As Integer = 0, _
Optional strPrefix As String, _
Optional strSuffix As String, _
Optional strCntryCode As String = "1", _
Optional strFilter As String)

On Error GoTo Error_Handler

Dim objFax As Object
Dim strAC As String
Dim strFax As String
Dim strDate As String
Dim strTime As String

DoCmd.SetWarnings False

Set objFax = CreateObject("WinFax.SDKSend")

If Len(strPrefix) > 0 Then strPrefix = strPrefix & ","
If Len(strSuffix) > 0 Then strSuffix = ",," & strSuffix

If blnLocal Then
strFax = strPrefix & Mid(strFaxNumber, 4, 7) & strSuffix
Else
strFax = strPrefix & strCntryCode & strFaxNumber & strSuffix
End If

strDate = CStr(Date)
strTime = Format(DateAdd("h", intDelay, Time), "hh:nn:ss")

If Val(Left(strTime, 2)) < Val(Left(Time, 2)) _
Then strDate = CStr(Date + 1)

With objFax
.SetDate (strDate)
.SetTime (strTime)
.SetNumber (strFax)
.SetTo (strName)
.AddRecipient
.SetPrintFromApp (1)
.Send (1)
Do While .IsReadyToPrint = 0
DoEvents
Loop

DoCmd.OpenReport strReport, acViewNormal, , strFilter

Delay (0.2)
.Done
Delay (0.2)

End With
Set objFax = Nothing

DoCmd.SetWarnings True

Exit_Here:
DoCmd.SetWarnings True
Exit Function

Error_Handler:
DoCmd.SetWarnings True
MsgBox Err.Number & ": " & Err.Description
Resume Exit_Here

End Function

Public Function Delay(dblInterval As Double)
'----------------------------------------------
' Name: Delay
' Purpose: Generic delay code
' Inputs: dblInterval As Double
' Author: Arvin Meyer
' Date: January 2, 1999
' Comment:
'----------------------------------------------
On Error GoTo Err_Delay
Dim Timer1 As Double
Dim Timer2 As Double

Timer1 = Timer()
Do Until Timer2 >= Timer1 + dblInterval
DoEvents
Timer2 = Timer()
Loop

Exit_Delay:
Exit Function

Err_Delay:
Select Case Err

Case Else
MsgBox Err.Description
Resume Exit_Delay
End Select

End Function


--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

lmv said:
When I open my report and then right mouse to get to print then go to fax
by
the time I get to the fax I have forgotten the number the report needs to
be
faxed to and unlike word it doesn't search for a phone number and fill in
the
box. SO, I have created a form that comes up the same time as the report
with
the fax number focused so I can copy and paste. BUT, it is not getting the
same filtered information as the report. Can someone tell me how to call
the
form at the same time as the report WITH the same filtered info? Both the
report and the faxform are based on the same qry.
I tried below but it doesn't filter properly. I also tried with the filter
below the form again but it doesn't work either. By the way is there any
way
to have this trigger only IF someone goes to the fax option in the windows
drop down?
The cmd button is on the OrderWDetails form...
Thanx!!

Private Sub cmdPrevEstimate_Click()
On Error GoTo Err_cmdPrevEstimate_Click

DoCmd.OpenReport "rptEstimateHUPA", acPreview
Reports![rptEstimateHUPA].Filter = "OrderID = " & Me![OrderID]
Reports![rptEstimateHUPA].FilterOn = True
DoCmd.RunCommand acCmdZoom100
DoCmd.MoveSize 1, 1, 13000, 9100
DoCmd.OpenForm "f_Supplierfax"
Exit_cmdPrevEstimate_Click:
Exit Sub

Err_cmdPrevEstimate_Click:
MsgBox err.Description
Resume Exit_cmdPrevEstimate_Click

End Sub
 
A

Arvin Meyer [MVP]

I no longer have WinFax, and, in fact, email everything now as a PDF file,
so all I can do is give you some general help.

Put both of those functions in a standard module, and add a command button
to your form. In the command button's code call the function something like
this:

Sub cmdFAX_Click()
SendWinFax(Me.txtFaxNumber, "Report Name", Me.txtFullName)
End Sub

Which should be enough to get it going.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

lmv said:
Thanks my VBA is too basic to understand how to use this and since "if"
(which I don't know how to determine) I have winfax I don't know what to
do
to change the code to work with XP and for the moment I just need to be
able
to get the form to filter to the same info as my report. Maybe later I can
figure out how to apply what you gave me to XP...

If you can point me to some additional information in how to use the code
I'd appreciate the direction.
Thanks


Arvin Meyer said:
Here's some code posted 5 or 6 years ago with some modifications by me
which
works with WinFax. I haven't tested it since then on newer versions of
Access WinFax or Windows:

Function SendWinFax(strFaxNumber As String, _
strReport As String, _
Optional strName As String, _
Optional blnLocal As Boolean = False, _
Optional intDelay As Integer = 0, _
Optional strPrefix As String, _
Optional strSuffix As String, _
Optional strCntryCode As String = "1", _
Optional strFilter As String)

On Error GoTo Error_Handler

Dim objFax As Object
Dim strAC As String
Dim strFax As String
Dim strDate As String
Dim strTime As String

DoCmd.SetWarnings False

Set objFax = CreateObject("WinFax.SDKSend")

If Len(strPrefix) > 0 Then strPrefix = strPrefix & ","
If Len(strSuffix) > 0 Then strSuffix = ",," & strSuffix

If blnLocal Then
strFax = strPrefix & Mid(strFaxNumber, 4, 7) & strSuffix
Else
strFax = strPrefix & strCntryCode & strFaxNumber & strSuffix
End If

strDate = CStr(Date)
strTime = Format(DateAdd("h", intDelay, Time), "hh:nn:ss")

If Val(Left(strTime, 2)) < Val(Left(Time, 2)) _
Then strDate = CStr(Date + 1)

With objFax
.SetDate (strDate)
.SetTime (strTime)
.SetNumber (strFax)
.SetTo (strName)
.AddRecipient
.SetPrintFromApp (1)
.Send (1)
Do While .IsReadyToPrint = 0
DoEvents
Loop

DoCmd.OpenReport strReport, acViewNormal, , strFilter

Delay (0.2)
.Done
Delay (0.2)

End With
Set objFax = Nothing

DoCmd.SetWarnings True

Exit_Here:
DoCmd.SetWarnings True
Exit Function

Error_Handler:
DoCmd.SetWarnings True
MsgBox Err.Number & ": " & Err.Description
Resume Exit_Here

End Function

Public Function Delay(dblInterval As Double)
'----------------------------------------------
' Name: Delay
' Purpose: Generic delay code
' Inputs: dblInterval As Double
' Author: Arvin Meyer
' Date: January 2, 1999
' Comment:
'----------------------------------------------
On Error GoTo Err_Delay
Dim Timer1 As Double
Dim Timer2 As Double

Timer1 = Timer()
Do Until Timer2 >= Timer1 + dblInterval
DoEvents
Timer2 = Timer()
Loop

Exit_Delay:
Exit Function

Err_Delay:
Select Case Err

Case Else
MsgBox Err.Description
Resume Exit_Delay
End Select

End Function


--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

lmv said:
When I open my report and then right mouse to get to print then go to
fax
by
the time I get to the fax I have forgotten the number the report needs
to
be
faxed to and unlike word it doesn't search for a phone number and fill
in
the
box. SO, I have created a form that comes up the same time as the
report
with
the fax number focused so I can copy and paste. BUT, it is not getting
the
same filtered information as the report. Can someone tell me how to
call
the
form at the same time as the report WITH the same filtered info? Both
the
report and the faxform are based on the same qry.
I tried below but it doesn't filter properly. I also tried with the
filter
below the form again but it doesn't work either. By the way is there
any
way
to have this trigger only IF someone goes to the fax option in the
windows
drop down?
The cmd button is on the OrderWDetails form...
Thanx!!

Private Sub cmdPrevEstimate_Click()
On Error GoTo Err_cmdPrevEstimate_Click

DoCmd.OpenReport "rptEstimateHUPA", acPreview
Reports![rptEstimateHUPA].Filter = "OrderID = " & Me![OrderID]
Reports![rptEstimateHUPA].FilterOn = True
DoCmd.RunCommand acCmdZoom100
DoCmd.MoveSize 1, 1, 13000, 9100
DoCmd.OpenForm "f_Supplierfax"
Exit_cmdPrevEstimate_Click:
Exit Sub

Err_cmdPrevEstimate_Click:
MsgBox err.Description
Resume Exit_cmdPrevEstimate_Click

End Sub
 
G

Guest

Thanks for the suggestions. Since I don't have WinFax I have set the reports
that are necessary to be faxed to print to the "fax -printer" and I figured
out how to filter the other form so I have the phone number accessable.

Thanks anyway!
Arvin Meyer said:
I no longer have WinFax, and, in fact, email everything now as a PDF file,
so all I can do is give you some general help.

Put both of those functions in a standard module, and add a command button
to your form. In the command button's code call the function something like
this:

Sub cmdFAX_Click()
SendWinFax(Me.txtFaxNumber, "Report Name", Me.txtFullName)
End Sub

Which should be enough to get it going.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

lmv said:
Thanks my VBA is too basic to understand how to use this and since "if"
(which I don't know how to determine) I have winfax I don't know what to
do
to change the code to work with XP and for the moment I just need to be
able
to get the form to filter to the same info as my report. Maybe later I can
figure out how to apply what you gave me to XP...

If you can point me to some additional information in how to use the code
I'd appreciate the direction.
Thanks


Arvin Meyer said:
Here's some code posted 5 or 6 years ago with some modifications by me
which
works with WinFax. I haven't tested it since then on newer versions of
Access WinFax or Windows:

Function SendWinFax(strFaxNumber As String, _
strReport As String, _
Optional strName As String, _
Optional blnLocal As Boolean = False, _
Optional intDelay As Integer = 0, _
Optional strPrefix As String, _
Optional strSuffix As String, _
Optional strCntryCode As String = "1", _
Optional strFilter As String)

On Error GoTo Error_Handler

Dim objFax As Object
Dim strAC As String
Dim strFax As String
Dim strDate As String
Dim strTime As String

DoCmd.SetWarnings False

Set objFax = CreateObject("WinFax.SDKSend")

If Len(strPrefix) > 0 Then strPrefix = strPrefix & ","
If Len(strSuffix) > 0 Then strSuffix = ",," & strSuffix

If blnLocal Then
strFax = strPrefix & Mid(strFaxNumber, 4, 7) & strSuffix
Else
strFax = strPrefix & strCntryCode & strFaxNumber & strSuffix
End If

strDate = CStr(Date)
strTime = Format(DateAdd("h", intDelay, Time), "hh:nn:ss")

If Val(Left(strTime, 2)) < Val(Left(Time, 2)) _
Then strDate = CStr(Date + 1)

With objFax
.SetDate (strDate)
.SetTime (strTime)
.SetNumber (strFax)
.SetTo (strName)
.AddRecipient
.SetPrintFromApp (1)
.Send (1)
Do While .IsReadyToPrint = 0
DoEvents
Loop

DoCmd.OpenReport strReport, acViewNormal, , strFilter

Delay (0.2)
.Done
Delay (0.2)

End With
Set objFax = Nothing

DoCmd.SetWarnings True

Exit_Here:
DoCmd.SetWarnings True
Exit Function

Error_Handler:
DoCmd.SetWarnings True
MsgBox Err.Number & ": " & Err.Description
Resume Exit_Here

End Function

Public Function Delay(dblInterval As Double)
'----------------------------------------------
' Name: Delay
' Purpose: Generic delay code
' Inputs: dblInterval As Double
' Author: Arvin Meyer
' Date: January 2, 1999
' Comment:
'----------------------------------------------
On Error GoTo Err_Delay
Dim Timer1 As Double
Dim Timer2 As Double

Timer1 = Timer()
Do Until Timer2 >= Timer1 + dblInterval
DoEvents
Timer2 = Timer()
Loop

Exit_Delay:
Exit Function

Err_Delay:
Select Case Err

Case Else
MsgBox Err.Description
Resume Exit_Delay
End Select

End Function


--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

When I open my report and then right mouse to get to print then go to
fax
by
the time I get to the fax I have forgotten the number the report needs
to
be
faxed to and unlike word it doesn't search for a phone number and fill
in
the
box. SO, I have created a form that comes up the same time as the
report
with
the fax number focused so I can copy and paste. BUT, it is not getting
the
same filtered information as the report. Can someone tell me how to
call
the
form at the same time as the report WITH the same filtered info? Both
the
report and the faxform are based on the same qry.
I tried below but it doesn't filter properly. I also tried with the
filter
below the form again but it doesn't work either. By the way is there
any
way
to have this trigger only IF someone goes to the fax option in the
windows
drop down?
The cmd button is on the OrderWDetails form...
Thanx!!

Private Sub cmdPrevEstimate_Click()
On Error GoTo Err_cmdPrevEstimate_Click

DoCmd.OpenReport "rptEstimateHUPA", acPreview
Reports![rptEstimateHUPA].Filter = "OrderID = " & Me![OrderID]
Reports![rptEstimateHUPA].FilterOn = True
DoCmd.RunCommand acCmdZoom100
DoCmd.MoveSize 1, 1, 13000, 9100
DoCmd.OpenForm "f_Supplierfax"
Exit_cmdPrevEstimate_Click:
Exit Sub

Err_cmdPrevEstimate_Click:
MsgBox err.Description
Resume Exit_cmdPrevEstimate_Click

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top