vipersmind
it can't be!
- Local time
- Tomorrow, 05:48
- Joined
- Dec 26, 2002
- Messages
- 82
This code calclulates Samples and sample intervals, well it used to but now it prompts the message:
User defined type not defined
Im' guessing it is something 97 did and now 2000 does it differently.
The red shows where I'm getting the probs.
Sub SampCal()
On Error GoTo ErrorHandler
Dim MyDb As Database
Dim SampleT As Table
Set MyDb = DBEngine.Workspaces(0).Databases(0)
Set SampleT = MyDb.OpenTable("SampleCalc")
Top = Forms!SamCalc![Top]
Bottom = Forms!SamCalc![Bottom]
Interval = Forms!SamCalc![SamInt]
NumSamp = Int((Bottom - Top) / Interval) - 1
Holeid = Forms!SamCalc![Holeid]
SampNum = Forms!SamCalc![SamFirst]
SampPre = Forms!SamCalc![SPrefix]
DepFrom = Top - Interval
SampNum = SampNum - 1
For x = 0 To NumSamp Step 1
DepFrom = DepFrom + Interval
DepTo = DepFrom + Interval
SampNum = SampNum + 1
SampleT.AddNew
SampleT![Holeid] = Holeid
SampleT![From] = DepFrom
SampleT![To] = DepTo
SampleT![SAMPLEID] = SampPre & Format$(SampNum, "00")
SampleT.Update
Next x
SampleT.Close
MsgBox "Completed!" & vbCrLf _
& vbCrLf _
& "View and Check Before Appending", vbInformation
Exit Sub
ErrorHandler:
Select Case Err
Case 3022: MsgBox "This Sample Range is already calculated!.", vbExclamation
Case 13: MsgBox "What the hell are you doing to me ?"
Case Else
MsgBox " Error " & Err & " Occurred - Easy Tiger.....what are you doing out there? !"
End Select
SampleT.Close
Exit Sub
Resume Next
End Sub
Hope you get what it does from this
Cheers
Last edited: