Ryobi
Registered User.
- Local time
- Today, 02:27
- Joined
- Mar 5, 2012
- Messages
- 49
Hello,
I hope somebody can help me with this simple problem. I created a public procedure in a Class module, but for some reason I can not call the procedure from a form. The code on the Class module is as follows:
Public Class Module1
Public FileInuse As String
Public Sub GetDataFile()
Dim file_path As String = Application.StartupPath
file_path = file_path.Substring(0,
file_path.LastIndexOf(""))
FileInuse = file_path & "\DataFile.txt"
End Sub
End Class
The code on the form is as follows:
Dim Datafile As String
GetDataFile()
Datafile = FileInuse
I am trying to get the value of the of the public string FileInuse, but for some reason it does not want to work. I have tried Call GetDatafile(), Datafile() and Datafile but not luck. Ideally, I just want want the value of the FileInuse without calling the procedure such:
Dim Datafile As String Datafile = FileInuse
But the Fileinuse does not have a value because the produrec needs to be called.
Any ideas or suggestions are well come.
Thanks
I hope somebody can help me with this simple problem. I created a public procedure in a Class module, but for some reason I can not call the procedure from a form. The code on the Class module is as follows:
Public Class Module1
Public FileInuse As String
Public Sub GetDataFile()
Dim file_path As String = Application.StartupPath
file_path = file_path.Substring(0,
file_path.LastIndexOf(""))
FileInuse = file_path & "\DataFile.txt"
End Sub
End Class
The code on the form is as follows:
Dim Datafile As String
GetDataFile()
Datafile = FileInuse
I am trying to get the value of the of the public string FileInuse, but for some reason it does not want to work. I have tried Call GetDatafile(), Datafile() and Datafile but not luck. Ideally, I just want want the value of the FileInuse without calling the procedure such:
Dim Datafile As String Datafile = FileInuse
But the Fileinuse does not have a value because the produrec needs to be called.
Any ideas or suggestions are well come.
Thanks