Error when opening form (1 Viewer)

lipin

Registered User.
Local time
Today, 07:49
Joined
May 21, 2002
Messages
149
I have a button that opens another form to enter data on. But when I click the button I am getting the error msg: "Can't find project or library." And the debugger goes to the following sub routine and highlights Date in 3rd line(tried to bold).

This only happens on 1 user's machine. The other 4 computers open it flawlessly. All 5 have the same setup/security. Don't know why it works on 4 and not the last one. Any ideas?

(Access97.)
Private Sub Form_Open(Cancel As Integer)
Dim x As Long
Me.txtEntryDate.Value = Date
Me.lblErrMsg.Caption = ""

CurrentRateCode = ""
CurrentUnitFactor = 0
CurrentCartonFactor = 0

Set PTdb = CurrentDb()
Dim rsVASRate As Recordset

Set rsVASRate = PTdb.OpenRecordset("SELECT * FROM tblVASRateCodes", dbOpenDynaset)
x = 0
Do Until rsVASRate.EOF
VASRate(x).RateCode = rsVASRate(0)
VASRate(x).UnitFactor = rsVASRate("UnitValue")
VASRate(x).CartonFactor = rsVASRate("CartonValue")
x = x + 1
rsVASRate.MoveNext
Loop

VASRateTableCount = x - 1

rsVASRate.Close

DoCmd.RunSQL ("DELETE * FROM tblVASData") 'clear VAS data summary table

If TableExists("tblVASEntry") Then
DoCmd.RunSQL ("DELETE * FROM tblVASEntry") 'clear VAS data entry table
Me.subform_VASEntry.Requery
Else
DoCmd.RunSQL ("CREATE TABLE tblVASEntry (VEID IDENTITY PRIMARY, 'Rate Code' INTEGER, Units INTEGER, Cartons INTEGER);")
End If

End Sub
 

boblarson

Smeghead
Local time
Yesterday, 23:49
Joined
Jan 12, 2001
Messages
32,059
The problem is a missing reference. From the computer that has the problem, open up the VB IDE Window and go to Tools / References and check to see if one is marked as MISSING.

Uncheck it and close the dialog and database and reopen it. It should work for you. If not, you need to uncheck and then browse to the location of the file that is listed as missing.

One other thing that can cause this is if the MDAC on the 4 machines is a higher version than the MDAC on the 1 that doesn't work.

And, sometimes it won't be marked missing. So, for date, the usual culprit file is Comctl32.ocx.
 

Users who are viewing this thread

Top Bottom