I'm having trouble in Access trying to work with a UDT as a whole/record. I seem to recall that this is a limitation in Access that is not in VB6.
Specifically, I'd like to be able to initialize the record with spaces and be able to write it to disk as a whole with the Write or Print statement.
Is there a workaround for this? Maybe an API call?
Thanks,
Brooks
Option Compare Database
Option Explicit
Type CustomerRecord
Customername As String * 50
Address1 As String * 50
' many more fields
End Type
Sub Main()
Dim custrec As CustomerRecord
custrec = Space(100) ' gives a compile error
LSet custrec = Space(100) ' gives error 13
custrec.Customername = "anyname"
custrec.Address1 = "anystreet"
MsgBox custrec ' gives a compile error
End Sub
Specifically, I'd like to be able to initialize the record with spaces and be able to write it to disk as a whole with the Write or Print statement.
Is there a workaround for this? Maybe an API call?
Thanks,
Brooks
Option Compare Database
Option Explicit
Type CustomerRecord
Customername As String * 50
Address1 As String * 50
' many more fields
End Type
Sub Main()
Dim custrec As CustomerRecord
custrec = Space(100) ' gives a compile error
LSet custrec = Space(100) ' gives error 13
custrec.Customername = "anyname"
custrec.Address1 = "anystreet"
MsgBox custrec ' gives a compile error
End Sub