variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!
I have this
Option Compare Database
Public bruger2 As String
Dim bruger As String
Dim password As String
I use this in my code it's working all right i have the code in the start
of a form.
Now i want to use the value off bruger2 in another form but its emthy?

Then i read someting about i should make a function to my value
i make this:

Function Hentbruger() As String
Hentbruger = bruger2

End Function

But in another form Hentbruger is also emthy ?????

CAn someone please help?

Best regards alvin
 
It's not clear from what you've posted whether your

Public bruger2 As String

statement is in the VB associated with a form or in a stand-alone module. It
should be the latter if you want to be able to access the value in another
form. An alternative is, if that's Form1, to use Form_Form1.bruger2 in your
other form.

The same is true of public functions in forms.
 
Back
Top