variable

A

Alvin Hansen

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
 
D

Douglas J. Steele

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.
 

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