I have created a public type called specimen in a standard module. I use the information in several forms so I originally created it like this to keep from having to pass all the variables around. I am now trying to rework how the DB is designed. Instead of making a global specimen, I need to make one and pass it from function to function until I'm done with it. Doing this globally is dangerous because I might not have the newest values loaded.
My problem is passing the variable. Everytime I instantiate the variable and try to pass it, I get an error saying only public object types can be passed. If its declaired Public Type in my public module.. is it not public?
This is in my public module:
I instantiate the variable using a function..
I use it like so..
I'm not used to doing this with VB. Is this not possible?
Bonus Questions: Does VB treat types like java and c++ treats arrays and classes? Is the variable actually just a pointer? Would it be better to create a class called specimen? -Dustin
Rom 8:28
My problem is passing the variable. Everytime I instantiate the variable and try to pass it, I get an error saying only public object types can be passed. If its declaired Public Type in my public module.. is it not public?
This is in my public module:
Code:
Public Type Specimen
Dim patientNumber As Integer
Dim year As String
Dim sType As String
Dim TestType As String
Dim test As String
Dim number As String
Dim untouched As String
Dim formated As String
Dim other As String
Dim valid As Boolean
End Type
I instantiate the variable using a function..
Code:
Public Function ValidSpecimenCode(Code As String) As Specimen
dim spcCode as Specimen
spcCode.untouched = Code
'other code to format the code and fill vars..
.......
ValidSpecimenCode = spcCode
End Function
Code:
dim spcCode as Specimen
spcCode = ValidSpecimenCode("01-0002-GB")
I'm not used to doing this with VB. Is this not possible?
Bonus Questions: Does VB treat types like java and c++ treats arrays and classes? Is the variable actually just a pointer? Would it be better to create a class called specimen? -Dustin
Rom 8:28