473,386 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

make a variable go from one form to another

I have a login form that runs off of a access database. When you type in the
username and password it will use that information in the select query it
pulls all the information in that record. It will put a number in a
invisible textbox in the login form. Then it runs a if then statment to see
what the number in the textbox is. I was wondering if there is a way to make
that number stay in a varible so you can go back and use that same number on
another form.

Thank you
Nov 20 '05 #1
1 985
Hey Wes try this,

Module MyGroovyModule

Public UserCreds As New UserDetails ' Establish your User Credential
object

Sub main()
Dim Login As New frmLogin
Application.Run(Login)
' Code in your login form might look like
' ... get userid
' UserCreds.UserID = iUserID
' Code in your Query might look something like;
' Select * from foo where User_ID = UserCreds.UserID
End Sub

End Module

Class UserDetails

Private m_User_ID As Integer = 0
Property UserID() As Integer
Get
Return m_User_ID
End Get
Set(ByVal Value As Integer)
If m_User_ID = 0 Then ' In effect make this a write once read
many
m_User_ID = Value ' Set your value
End If
End Set
End Property

' You can add other items here for ready reference such as access level
:o

End Class

HTH,

"Wes McCaslin" <no***********@olp.net> wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
I have a login form that runs off of a access database. When you type in the username and password it will use that information in the select query it
pulls all the information in that record. It will put a number in a
invisible textbox in the login form. Then it runs a if then statment to see what the number in the textbox is. I was wondering if there is a way to make that number stay in a varible so you can go back and use that same number on another form.

Thank you

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: AnnMarie | last post by:
<script language="JavaScript" type="text/javascript"> <!-- function validate(theForm) { var validity = true; // assume valid if(frmComments.name.value=='' && validity == true) { alert('Your...
4
by: JC Mugs | last post by:
Problem: Have a data entry form that enters new records that we need to print invoices from when the form is completed. I expect to be able to place a command button on the form and print the...
2
by: RD | last post by:
My application contains several Classes & Forms . From the Login form I will get the User ID and Password for the SqlConnection. I established the connection through another class and...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
4
by: damn | last post by:
Hi, in short what I'm trying to do: pass a variable from a form that's posted to a certain page, to the same page. The variable is extracted with $_REQUEST. Next, another form in the same page...
4
by: adodotnet20 | last post by:
I'm developing a Windows application and I'm having some problems in making variable accessible to the whole application. I use VS.NET 2005 and I create a database connection object in the method ...
112
by: istillshine | last post by:
When I control if I print messages, I usually use a global variable "int silent". When I set "-silent" flag in my command line parameters, I set silent = 1 in my main.c. I have many functions...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
5
by: timber910 | last post by:
I posted this in the VB forum but I think its in the wrong place. So I thought I would try here. _________________________________________ Ok, I have a button on a form that I'm using to create...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.