Access 2010 64 bit form issue (1 Viewer)

Artistlover

New member
Local time
Yesterday, 17:25
Joined
Mar 9, 2012
Messages
3
I have a form that will not open in access 2010 64 bit version. It indicates access has to close when i try. The code looks as follows..

Private Sub Form_Open(Cancel As Integer)
Static MouseHook As Object
Set MouseHook = NewMouseHook(Me)
End Sub
Private Sub ShipperCode_AfterUpdate()
Me.CustID = Me.ShipperCode.Column(0)
Me.Shipper = Me.ShipperCode.Column(2)
End Sub
Private Sub ShipperCode_NotInList(NewData As String, Response As Integer)
Dim MsgStr As String

MsgStr = "'" & NewData & "' is not currently in the list. Do you want to add it?"

If vbYes = MsgBox(MsgStr, vbYesNo + vbQuestion, "Unknown Shipper Code...") Then
DoCmd.OpenForm "frmAddShipper", acNormal, , , acFormAdd, acDialog
Response = acDataErrAdded
Else
Response = acDataErrDisplay
End If
End Sub
Private Sub cmdTempClose_Click()
On Error GoTo Err_cmdTempClose_Click

DoCmd.Close
Exit_cmdTempClose_Click:
Exit Sub
Err_cmdTempClose_Click:
MsgBox Err.Description
Resume Exit_cmdTempClose_Click

End Sub
Private Sub cmdAddNewLotNo_Click()
On Error GoTo Err_cmdAddNewLotNo_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdAddNewLotNo_Click:
Exit Sub
Err_cmdAddNewLotNo_Click:
MsgBox Err.Description
Resume Exit_cmdAddNewLotNo_Click

End Sub
Private Sub cmdViewAllLots_Click()
On Error GoTo Err_cmdViewAllLots_Click
cNextLot.Visible = True
cPreviousLot.Visible = True
' Me.FilterOn = False
Me.Filter = "[Shipper] = '" & Shipper & "'"
Me.OrderBy = "FINISHED, CustInvID DESC"
Me.OrderByOn = True
Exit_cmdViewAllLots_Click:
Exit Sub
Err_cmdViewAllLots_Click:
MsgBox Err.Description
Resume Exit_cmdViewAllLots_Click

End Sub
Private Sub cmdAttachDoc_Click()
On Error GoTo Err_cmdAttachDoc_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmDocumentsLotNo"
stLinkCriteria = "[FDWLotNo]=" & "'" & Me![FDWLotNo] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Forms![frmDocumentsLotNo]!FDWLotNo.Value = Forms![frmCustomerInventory2]!FDWLotNo
Exit_cmdAttachDoc_Click:
Exit Sub
Err_cmdAttachDoc_Click:
MsgBox Err.Description
Resume Exit_cmdAttachDoc_Click

End Sub
Private Sub cmdViewDoc_Click()
On Error GoTo Err_cmdViewDoc_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmDocumentsLotNo"
stLinkCriteria = "[FDWLotNo]=" & "'" & Me![FDWLotNo] & "'"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_cmdViewDoc_Click:
Exit Sub
Err_cmdViewDoc_Click:
MsgBox Err.Description
Resume Exit_cmdViewDoc_Click
End Sub
Private Sub cNextLot_Click()
On Error Resume Next
DoCmd.GoToRecord , , acNext
End Sub
Private Sub cPreviousLot_Click()
On Error Resume Next
DoCmd.GoToRecord , , acPrevious
End Sub


I cannot figure anything out on why this won't open.
 

missinglinq

AWF VIP
Local time
Yesterday, 20:25
Joined
Jun 20, 2003
Messages
6,423
I don't run 2010 and so can't try to reproduce your problem, but the fact that the Form will not even Open would make me first look at the Form_Open event.

What exactly is the code below supposed to be doing?

What is Mousehook?
Code:
Private Sub Form_Open(Cancel As Integer)
 Static MouseHook As Object
 Set MouseHook = NewMouseHook(Me)
End Sub
I can say that in all versions of Access, the Form_Open event is usually too early to be doing any kind of assignment, such as you're doing with

Set MouseHook = NewMouseHook(Me)

and my first approach would be to move the code to the Form_Load event.

Linq ;0)>
 

Banana

split with a cherry atop.
Local time
Yesterday, 17:25
Joined
Sep 1, 2005
Messages
6,318
Isn't Mousehook a workaround for older Access versions where there were no Mouse scroll events? This also involves APIs and if you didn't update the API declarations properly, it may not work correctly.

You should not need Mousehook since Mouse Scroll is now an available event since 2007.
 

missinglinq

AWF VIP
Local time
Yesterday, 20:25
Joined
Jun 20, 2003
Messages
6,423
There was a Mousehook.DLL that Stephen Lebans used as part of his well-known hack to prevent scrolling Records with the Mouse Wheel, but it's implementation was nothing like this.

Linq ;0)>
 

Artistlover

New member
Local time
Yesterday, 17:25
Joined
Mar 9, 2012
Messages
3
I'll give that a try. I didn't know about the mousehook not being needed. Thank you for answering.
 

Users who are viewing this thread

Top Bottom