Stephen,
Here is the code from my form. As I mentioned earlier, my VB skills are
low, so any help you can provide will be greatly appreciated.
----------------------------------------------------------------------------------
Option Compare Database
' Copyright Lebans Holdings 1999 Ltd.
'
www.lebans.com
' You are free to use the MouseHook.dll in any of your applications,
' whether personal or commercial providing you are not selling this DLL
' by itself or as part of a collection.
' You must copy the MouseHook.dll file into either your
' Windows System folder or into the same folder where this MDB resides.
' If you are distributing Front End/Back End MDBs then ensure that the
' MouseHook.dll file is copied to the same folder where the FRONT END MDB
resides.
' The MouseHook.dll is NOT an ActiveX DLL that must be registered.
' Just copy the DLL to one of the folders as indicated above.
Private Sub Command14_Click()
' Turn the MouseWheel Off
Dim blRet As Boolean
' Call our MouseHook function in the MouseHook dll.
' Please not the Optional GlobalHook BOOLEAN parameter
' Several developers asked for the MouseHook to be able to work with
' multiple instances of Access. In order to accomodate this request I
' have modified the function to allow the caller to
' specify a thread specific(this current instance of Access only) or
' a global(all applications) MouseWheel Hook.
' Only use the GlobalHook if you will be running multiple instances of Access!
blRet = MouseWheelOFF(True, False)
Me.txtStatus.Value = "The MouseWheel is turned OFF except for ListBox
controls, TextBox controls with ScrollBars and the Record Navigation control"
End Sub
Private Sub Command28_Click()
On Error GoTo Err_Command28_Click
' Screen.PreviousControl.SetFocus
' DoCmd.FindNext
Exit_Command28_Click:
Exit Sub
Err_Command28_Click:
MsgBox Err.Description
Resume Exit_Command28_Click
End Sub
Private Sub Command17_Click()
On Error GoTo Err_Command17_Click
DoCmd.Close
Exit_Command17_Click:
Exit Sub
Err_Command17_Click:
MsgBox Err.Description
Resume Exit_Command17_Click
End Sub
Private Sub Command19_Click()
On Error GoTo Err_Command19_Click
DoCmd.Close
Exit_Command19_Click:
Exit Sub
Err_Command19_Click:
MsgBox Err.Description
Resume Exit_Command19_Click
End Sub
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click
DoCmd.Quit
Exit_Command20_Click:
Exit Sub
Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click
End Sub
Private Sub Command23_Click()
On Error GoTo Err_Command23_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Exit_Command23_Click:
Exit Sub
Err_Command23_Click:
MsgBox Err.Description
Resume Exit_Command23_Click
End Sub
Private Sub Command24_Click()
On Error GoTo Err_Command24_Click
Dim stDocName As String
stDocName = "Texas City Supply - Loaded Railcars"
DoCmd.SendObject acReport, stDocName
Exit_Command24_Click:
Exit Sub
Err_Command24_Click:
MsgBox Err.Description
Resume Exit_Command24_Click
End Sub
Private Sub Command25_Click()
On Error GoTo Err_Command25_Click
Dim stDocName As String
stDocName = "Railcar Movement Request"
DoCmd.SendObject acReport, stDocName
Exit_Command25_Click:
Exit Sub
Err_Command25_Click:
MsgBox Err.Description
Resume Exit_Command25_Click
End Sub
Private Sub Command26_Click()
On Error GoTo Err_Command26_Click
Dim stDocName As String
stDocName = "Railcar Movement Request-CAT"
DoCmd.RunMacro stDocName
Exit_Command26_Click:
Exit Sub
Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click
End Sub
Private Sub Command27_Click()
On Error GoTo Err_Command27_Click
Dim stDocName As String
stDocName = "Railcar Movement Request-SPP"
DoCmd.RunMacro stDocName
Exit_Command27_Click:
Exit Sub
Err_Command27_Click:
MsgBox Err.Description
Resume Exit_Command27_Click
End Sub
Private Sub Command29_Click()
On Error GoTo Err_Command29_Click
Dim stDocName As String
stDocName = "Railcar Movement Request-GAR"
DoCmd.RunMacro stDocName
Exit_Command29_Click:
Exit Sub
Err_Command29_Click:
MsgBox Err.Description
Resume Exit_Command29_Click
End Sub
Private Sub Command30_Click()
On Error GoTo Err_Command30_Click
Dim stDocName As String
stDocName = "Railcar Movement Request-ROB"
DoCmd.RunMacro stDocName
Exit_Command30_Click:
Exit Sub
Err_Command30_Click:
MsgBox Err.Description
Resume Exit_Command30_Click
End Sub
Private Sub Command31_Click()
On Error GoTo Err_Command31_Click
Dim stDocName As String
stDocName = "Railcar Movement Request-Cancel"
DoCmd.RunMacro stDocName
Exit_Command31_Click:
Exit Sub
Err_Command31_Click:
MsgBox Err.Description
Resume Exit_Command31_Click
End Sub
Private Sub Command33_Click()
On Error GoTo Err_Command33_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Exit_Command33_Click:
Exit Sub
Err_Command33_Click:
MsgBox Err.Description
Resume Exit_Command33_Click
End Sub
Private Sub Command34_Click()
On Error GoTo Err_Command34_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Exit_Command34_Click:
Exit Sub
Err_Command34_Click:
MsgBox Err.Description
Resume Exit_Command34_Click
End Sub
Private Sub Command35_Click()
On Error GoTo Err_Command35_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Exit_Command35_Click:
Exit Sub
Err_Command35_Click:
MsgBox Err.Description
Resume Exit_Command35_Click
End Sub
Private Sub Command36_Click()
On Error GoTo Err_Command36_Click
Dim stDocName As String
stDocName = "Railcar Movement Request-Cancel"
DoCmd.RunMacro stDocName
Exit_Command36_Click:
Exit Sub
Err_Command36_Click:
MsgBox Err.Description
Resume Exit_Command36_Click
End Sub
Private Sub Command37_Click()
On Error GoTo Err_Command37_Click
Dim stDocName As String
stDocName = "Railcar Movement Request-Cancel"
DoCmd.RunMacro stDocName
Exit_Command37_Click:
Exit Sub
Err_Command37_Click:
MsgBox Err.Description
Resume Exit_Command37_Click
End Sub
Private Sub Detail_Click()
End Sub
Private Sub Command16_Click()
' Turn the MouseWheel On
Dim blRet As Boolean
blRet = MouseWheelON
Me.txtStatus.Value = "The MouseWheel is turned ON"
End Sub
Private Sub Form_Load()
End Sub