Dim for Public Variables

J

John

The database that I am using contains 4 public variables listed below.

Public EmuID As String
Public PMR As String
Public FirstN As String
Public LastN As String
Function GetValueFirstN()
GetValueFirstN = FirstN
End Function
Function GetValueLastN()
GetValueLastN = LastN
End Function
Function GetValuePMR()
GetValuePMR = PMR
End Function
Function GetValueEmuID()
GetValueEmuID = EmuID
End Function

Should I be using Dim statements with each vairable such as
Dim EmuID as String?

I tried this earlier, but it did not seem to work. Maybe I was doing
something wrong.

Thanks for you help
 
M

Marshall Barton

John said:
The database that I am using contains 4 public variables listed below.

Public EmuID As String
Public PMR As String
Public FirstN As String
Public LastN As String
Function GetValueFirstN()
GetValueFirstN = FirstN
End Function
Function GetValueLastN()
GetValueLastN = LastN
End Function
Function GetValuePMR()
GetValuePMR = PMR
End Function
Function GetValueEmuID()
GetValueEmuID = EmuID
End Function

Should I be using Dim statements with each vairable such as
Dim EmuID as String?

No.

That code is logical the way it is.

I tried this earlier, but it did not seem to work. Maybe I was doing
something wrong.

What does "did not seem to work" mean?

You should investigate when/where/how the public variables
are set.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top