M
Montana DOJ Help Desk
Word 2000
I'm trying to create a user-define type. This is the first time I've tried
to do this, so I've been reading through the on-line Help trying to figure
it out. Here's what I have so far:
********************
' Code placed in a standard module containing only public declarations.
Type ErrorRecord
ErrDateTime As Date
ModuleName As String
Subroutine As String
ErrNumber As Long
ErrHelpContext As Long
ErrDescription As String
ErrHelpFile As String
End Type
' Code placed in the routine.
Dim ErrorRecord As ErrorRecord
With ErrorRecord
.ErrDateTime = ErrDateTime
.ModuleName = ModuleName
.Subroutine = Subroutine
.ErrNumber = Err.Number
.ErrHelpContext = Err.HelpContext
.ErrDescription = Err.Description
.ErrHelpFile = Err.HelpFile
End With
FileNumber = FreeFile
Open ErrorLog For Random As FileNumber Len = Len(ErrorRecord) + 2
Put #FileNumber, , ErrorRecord
********************
On the PUT statement I get:
Run-time error '59':
Bad record length
From reading the Help on this error, I understand what the problem is, but
I'm having difficulty determining how to set the proper record length.
Hopefully, I've provided enough information for someone to answer my
question. Given the above, how do I get the record length set properly?
-- Tom
State of Montana
Department of Justice Help Desk
"Making the world a safer place."
I'm trying to create a user-define type. This is the first time I've tried
to do this, so I've been reading through the on-line Help trying to figure
it out. Here's what I have so far:
********************
' Code placed in a standard module containing only public declarations.
Type ErrorRecord
ErrDateTime As Date
ModuleName As String
Subroutine As String
ErrNumber As Long
ErrHelpContext As Long
ErrDescription As String
ErrHelpFile As String
End Type
' Code placed in the routine.
Dim ErrorRecord As ErrorRecord
With ErrorRecord
.ErrDateTime = ErrDateTime
.ModuleName = ModuleName
.Subroutine = Subroutine
.ErrNumber = Err.Number
.ErrHelpContext = Err.HelpContext
.ErrDescription = Err.Description
.ErrHelpFile = Err.HelpFile
End With
FileNumber = FreeFile
Open ErrorLog For Random As FileNumber Len = Len(ErrorRecord) + 2
Put #FileNumber, , ErrorRecord
********************
On the PUT statement I get:
Run-time error '59':
Bad record length
From reading the Help on this error, I understand what the problem is, but
I'm having difficulty determining how to set the proper record length.
Hopefully, I've provided enough information for someone to answer my
question. Given the above, how do I get the record length set properly?
-- Tom
State of Montana
Department of Justice Help Desk
"Making the world a safer place."