marshallgrad
04-30-2014, 09:17 AM
START HERE WITH #1
==========================================================
Sub BUTCH_TEST()
' Generated by the Reflection Macro Recorder on 08-16-2013 07:55:22.98.
' Generated by Reflection for UNIX and OpenVMS 14.0.6.
' BUTCH JONES 8/16/2013
On Error GoTo ErrorHandler
Const NEVER_TIME_OUT = 0
Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M
LF = Chr(Reflection2.ControlCodes.rcLF)
CR = Chr(Reflection2.ControlCodes.rcCR)
With Session
.MsgBox "HELLO BUTCH, READY TO BEGIN? "
Call COMPUTER_NAME
.MsgBox "THE LABEL PRINTER YOU HAVE SELECTED IS: " & LABELPRINTER
End With
Exit Sub
ErrorHandler:
Session.MsgBox Err.Description, vbExclamation + vbOKOnly
' Recording stopped at 07:55:41.87.
End Sub
==========================================================
I want to start in the module (not sure what these are called? forgive me << Newbie) above and then transfer to the module below using the "CALL COMPUTER_NAME".
I then want the module below to identify the appropriate computer terminal I am using and assign
default items as listed. Then the program will revert back to the above module where the appropriate
"LABELPRINTER" will be displayed in the message box above.
Sub COMPUTER_NAME()
' Generated by the Reflection Macro Recorder on 03-21-2014 08:33:15.97.
' Generated by Reflection for UNIX and OpenVMS 14.0.6.
On Error GoTo ErrorHandler
Const NEVER_TIME_OUT = 0
Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M
LF = Chr(Reflection2.ControlCodes.rcLF)
CR = Chr(Reflection2.ControlCodes.rcCR)
With Session
'++++++++++++++++++++++++++++++++++++
'LIST OF COMPUTER NAMES THROUGHOUT THE LAB
'HEME DESK = '5'
'HEME MAIL = '6'
'DIFF DESK = '7'
'URINE DESK = '8'
'+++++++++++++++++++++++++++++++++++++
'===============================================================
COMPNAME = VBA.Environ("COMPUTERNAME")
.MsgBox COMPNAME
If COMPNAME = "5" Then
'MICROBIOLOGY PRINTER
LABELPRINTER = "C89$PRT"
DEFAULT_ACCESSION_AREA = "MICRO"
ElseIf COMPNAME = "6" Then
'BLOOD BANK LABEL PRINTER
LABELPRINTER = "BLAB1"
DEFAULT_ACCESSION_AREA = "BLOOD BANK"
ElseIf COMPNAME = "7" Then
'URINE LABEL PRINTER
LABELPRINTER = "UR11"
DEFAULT_ACCESSION_AREA = "URINE"
Else
'HEME/CHEM PRINTER
LABELPRINTER = "C93$PRT"
DEFAULT_ACCESSION_AREA = "HEME"
End If
'===============================================================
End With
Exit Sub
ErrorHandler:
Session.MsgBox Err.Description, vbExclamation + vbOKOnly
' Recording stopped at 08:34:32.97.
End Sub
Thanks for any help that can be given. Since I am a newbie, please be gentle...
==========================================================
Sub BUTCH_TEST()
' Generated by the Reflection Macro Recorder on 08-16-2013 07:55:22.98.
' Generated by Reflection for UNIX and OpenVMS 14.0.6.
' BUTCH JONES 8/16/2013
On Error GoTo ErrorHandler
Const NEVER_TIME_OUT = 0
Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M
LF = Chr(Reflection2.ControlCodes.rcLF)
CR = Chr(Reflection2.ControlCodes.rcCR)
With Session
.MsgBox "HELLO BUTCH, READY TO BEGIN? "
Call COMPUTER_NAME
.MsgBox "THE LABEL PRINTER YOU HAVE SELECTED IS: " & LABELPRINTER
End With
Exit Sub
ErrorHandler:
Session.MsgBox Err.Description, vbExclamation + vbOKOnly
' Recording stopped at 07:55:41.87.
End Sub
==========================================================
I want to start in the module (not sure what these are called? forgive me << Newbie) above and then transfer to the module below using the "CALL COMPUTER_NAME".
I then want the module below to identify the appropriate computer terminal I am using and assign
default items as listed. Then the program will revert back to the above module where the appropriate
"LABELPRINTER" will be displayed in the message box above.
Sub COMPUTER_NAME()
' Generated by the Reflection Macro Recorder on 03-21-2014 08:33:15.97.
' Generated by Reflection for UNIX and OpenVMS 14.0.6.
On Error GoTo ErrorHandler
Const NEVER_TIME_OUT = 0
Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J
Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M
LF = Chr(Reflection2.ControlCodes.rcLF)
CR = Chr(Reflection2.ControlCodes.rcCR)
With Session
'++++++++++++++++++++++++++++++++++++
'LIST OF COMPUTER NAMES THROUGHOUT THE LAB
'HEME DESK = '5'
'HEME MAIL = '6'
'DIFF DESK = '7'
'URINE DESK = '8'
'+++++++++++++++++++++++++++++++++++++
'===============================================================
COMPNAME = VBA.Environ("COMPUTERNAME")
.MsgBox COMPNAME
If COMPNAME = "5" Then
'MICROBIOLOGY PRINTER
LABELPRINTER = "C89$PRT"
DEFAULT_ACCESSION_AREA = "MICRO"
ElseIf COMPNAME = "6" Then
'BLOOD BANK LABEL PRINTER
LABELPRINTER = "BLAB1"
DEFAULT_ACCESSION_AREA = "BLOOD BANK"
ElseIf COMPNAME = "7" Then
'URINE LABEL PRINTER
LABELPRINTER = "UR11"
DEFAULT_ACCESSION_AREA = "URINE"
Else
'HEME/CHEM PRINTER
LABELPRINTER = "C93$PRT"
DEFAULT_ACCESSION_AREA = "HEME"
End If
'===============================================================
End With
Exit Sub
ErrorHandler:
Session.MsgBox Err.Description, vbExclamation + vbOKOnly
' Recording stopped at 08:34:32.97.
End Sub
Thanks for any help that can be given. Since I am a newbie, please be gentle...