N
Neil
I have written a database App using Access XP and everything is working OK
except for one section where I have some code that will not run on machines
with Access 2000, but works fine with XP / 2003.
The code is executed by clicking a button on a form. All I get with 2000 is
the animation of the button being pressed, but nothing else happens.
The code is listed below:
MsgBox ("1")
'Define variable to hold field contents
Dim strManfID As String
Dim strclassification As String
Dim strTypeOfEquip As String
Dim strRangeModel As String
Dim strmanufacturer As String
Dim strDepartment As String
Dim strLocation As String
Dim intDrawerNumber As Integer
Dim strStatus As String
Dim strUsedOn As String
Dim dblNOT As Double
Dim dblPitch As Double
Dim dblPA As Double
Dim strScrewText As String
Dim dblScrewSize As Double
Dim strOrderNumber As String
Dim dteDateOrdered As Variant
Dim dteDateDue As Variant
Dim curPrice As Variant
Dim strDrgNo As String
Dim dteLastCal As Variant
Dim dteCalDue As Variant
Dim strCalFreq As String
Dim dteBackFromCal As String
Dim strCalOrderNo As String
Dim curCalCost As Variant
Dim dblCalsPerYear As Double
Dim strComments As String
Dim intGaugeNo As Integer
Dim strProject As String
MsgBox ("2")
'Transfer Field contents to variables
strManfID = Nz(Form.[Ser No], " ")
strclassification = Nz(Form.[Type of Equipment], " ")
strTypeOfEquip = Nz(Form.TypeOfequipmentSub, " ")
strRangeModel = Nz(Form.[Range / Model], " ")
strmanufacturer = Nz(Form.Text33, " ")
strDepartment = Nz(Form.Combo39, " ")
strLocation = Nz(Form.Text36, " ")
intDrawerNumber = Nz(Form.Text53, "0")
strStatus = Nz(Form.Status, " ")
strUsedOn = Nz(Form.Text85, " ")
dblNOT = Nz(Form.Text77, "0")
dblPitch = Nz(Form.Text79, "0")
dblPA = Nz(Form.Text81, "0")
strScrewText = Nz(Form.Text43, " ")
dblScrewSize = Nz(Form.Size, "0")
strOrderNumber = Nz(Form.Text61, " ")
dteDateOrdered = Nz(Form.Text63, "")
dteDateDue = Nz(Form.Text65, "")
curPrice = Nz(Form.Text67, "")
strDrgNo = Nz(Form.Text212, " ")
dteLastCal = Nz(Form.[Cal Date], "")
dteCalDue = Nz(Form.[Cal Due], "")
strCalFreq = Nz(Form.[Calibration Freq], " ")
dteBackFromCal = Nz(Form.Text45, " ")
strCalOrderNo = Nz(Form.Laboratory, " ")
curCalCost = Nz(Form.[Cal cost], "")
dblCalsPerYear = Nz(Form.[Cals per year], "0")
strComments = Nz(Form.Comments, " ")
strProject = Nz(Form.Text217, " ")
MsgBox ("3")
'Open recordset
Dim rsCurr As DAO.Recordset
Set rsCurr = CurrentDb().OpenRecordset("Select * from
GaugeCalibrationRecords")
'Get last gauge number and add 1
intGaugeNo = DMax("[GaugeNo]", "[GaugeCalibrationRecords]") + 1
'Transfer fields into table
With rsCurr
.AddNew
!SerNo = strManfID
!TypeOfEquipment = strclassification
!TypeOfequipmentSub = strTypeOfEquip
!RangeOrModel = strRangeModel
!Manufacturer = strmanufacturer
!Department = strDepartment
!Location = strLocation
!DrawerNumber = intDrawerNumber
!Status = strStatus
!UsedOn = strUsedOn
!NoOfTeeth = dblNOT
!Pitch = dblPitch
!PressureAngle = dblPA
!SizeText = strScrewText
!ThSize = dblScrewSize
!OrderNumber = strOrderNumber
If dteDateOrdered <> "" Then
!DateOrdered = dteDateOrdered
End If
If dteDateDue <> "" Then
!DateDue = dteDateDue
End If
If curPrice <> "" Then
!Price = curPrice
End If
!SupplierDrgNo = strDrgNo
If dteLastCal <> "" Then
!CalDate = dteLastCal
End If
If dteCalDue <> "" Then
!CalDue = dteCalDue
End If
!CalibrationFreq = strCalFreq
If curCalCost <> "" Then
!CalCost = curCalCost
End If
!CalsPerYear = dblCalsPerYear
!Comments = strComments
!GaugeNo = intGaugeNo
!InitialPC = strProject
.Update
End With
MsgBox ("Gauge Number " & intGaugeNo & " has been assigned to this item" &
Chr(13) & "Please check the Intranet listing for this gauge")
DoCmd.Close
End Sub
The Message Box commands are jsut my crude attempts at checking what's going
on, but I don't even see the first one so I can only deduce that the code
isn't being fired at all.
The database is saved as 2000 file format, and other code within the app
works fine.
Anybody seen anything like this before?
Thanks in advance
Neil
except for one section where I have some code that will not run on machines
with Access 2000, but works fine with XP / 2003.
The code is executed by clicking a button on a form. All I get with 2000 is
the animation of the button being pressed, but nothing else happens.
The code is listed below:
MsgBox ("1")
'Define variable to hold field contents
Dim strManfID As String
Dim strclassification As String
Dim strTypeOfEquip As String
Dim strRangeModel As String
Dim strmanufacturer As String
Dim strDepartment As String
Dim strLocation As String
Dim intDrawerNumber As Integer
Dim strStatus As String
Dim strUsedOn As String
Dim dblNOT As Double
Dim dblPitch As Double
Dim dblPA As Double
Dim strScrewText As String
Dim dblScrewSize As Double
Dim strOrderNumber As String
Dim dteDateOrdered As Variant
Dim dteDateDue As Variant
Dim curPrice As Variant
Dim strDrgNo As String
Dim dteLastCal As Variant
Dim dteCalDue As Variant
Dim strCalFreq As String
Dim dteBackFromCal As String
Dim strCalOrderNo As String
Dim curCalCost As Variant
Dim dblCalsPerYear As Double
Dim strComments As String
Dim intGaugeNo As Integer
Dim strProject As String
MsgBox ("2")
'Transfer Field contents to variables
strManfID = Nz(Form.[Ser No], " ")
strclassification = Nz(Form.[Type of Equipment], " ")
strTypeOfEquip = Nz(Form.TypeOfequipmentSub, " ")
strRangeModel = Nz(Form.[Range / Model], " ")
strmanufacturer = Nz(Form.Text33, " ")
strDepartment = Nz(Form.Combo39, " ")
strLocation = Nz(Form.Text36, " ")
intDrawerNumber = Nz(Form.Text53, "0")
strStatus = Nz(Form.Status, " ")
strUsedOn = Nz(Form.Text85, " ")
dblNOT = Nz(Form.Text77, "0")
dblPitch = Nz(Form.Text79, "0")
dblPA = Nz(Form.Text81, "0")
strScrewText = Nz(Form.Text43, " ")
dblScrewSize = Nz(Form.Size, "0")
strOrderNumber = Nz(Form.Text61, " ")
dteDateOrdered = Nz(Form.Text63, "")
dteDateDue = Nz(Form.Text65, "")
curPrice = Nz(Form.Text67, "")
strDrgNo = Nz(Form.Text212, " ")
dteLastCal = Nz(Form.[Cal Date], "")
dteCalDue = Nz(Form.[Cal Due], "")
strCalFreq = Nz(Form.[Calibration Freq], " ")
dteBackFromCal = Nz(Form.Text45, " ")
strCalOrderNo = Nz(Form.Laboratory, " ")
curCalCost = Nz(Form.[Cal cost], "")
dblCalsPerYear = Nz(Form.[Cals per year], "0")
strComments = Nz(Form.Comments, " ")
strProject = Nz(Form.Text217, " ")
MsgBox ("3")
'Open recordset
Dim rsCurr As DAO.Recordset
Set rsCurr = CurrentDb().OpenRecordset("Select * from
GaugeCalibrationRecords")
'Get last gauge number and add 1
intGaugeNo = DMax("[GaugeNo]", "[GaugeCalibrationRecords]") + 1
'Transfer fields into table
With rsCurr
.AddNew
!SerNo = strManfID
!TypeOfEquipment = strclassification
!TypeOfequipmentSub = strTypeOfEquip
!RangeOrModel = strRangeModel
!Manufacturer = strmanufacturer
!Department = strDepartment
!Location = strLocation
!DrawerNumber = intDrawerNumber
!Status = strStatus
!UsedOn = strUsedOn
!NoOfTeeth = dblNOT
!Pitch = dblPitch
!PressureAngle = dblPA
!SizeText = strScrewText
!ThSize = dblScrewSize
!OrderNumber = strOrderNumber
If dteDateOrdered <> "" Then
!DateOrdered = dteDateOrdered
End If
If dteDateDue <> "" Then
!DateDue = dteDateDue
End If
If curPrice <> "" Then
!Price = curPrice
End If
!SupplierDrgNo = strDrgNo
If dteLastCal <> "" Then
!CalDate = dteLastCal
End If
If dteCalDue <> "" Then
!CalDue = dteCalDue
End If
!CalibrationFreq = strCalFreq
If curCalCost <> "" Then
!CalCost = curCalCost
End If
!CalsPerYear = dblCalsPerYear
!Comments = strComments
!GaugeNo = intGaugeNo
!InitialPC = strProject
.Update
End With
MsgBox ("Gauge Number " & intGaugeNo & " has been assigned to this item" &
Chr(13) & "Please check the Intranet listing for this gauge")
DoCmd.Close
End Sub
The Message Box commands are jsut my crude attempts at checking what's going
on, but I don't even see the first one so I can only deduce that the code
isn't being fired at all.
The database is saved as 2000 file format, and other code within the app
works fine.
Anybody seen anything like this before?
Thanks in advance
Neil