473,796 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 994
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.UserI D = iUserID
' Code in your Query might look something like;
' Select * from foo where User_ID = UserCreds.UserI D
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******** ******@TK2MSFTN GP12.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
6258
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 full name is required. Please enter your full name!'); validity = false; frmComments.name.focus();
4
1775
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 invoice, but just can't seem to understand the correct way to pass the value to the report and return to a new form. The form uses tblInvoice as the data source, it has a primary key ID1
2
2779
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 I can get it in the Login form. In another form , say Employee form , I want to save the Employee details to the Employee table. But when I tried to use connection which is already opened I couldn't get it.
6
4904
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 the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
4
1394
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 is submitted, again to the same page. Following that, I have code depending on the submission of the latter form. In that code, I try to do something with the variable that has been submitted with the first form, but it's not there anymore. I...
4
10895
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 private void connect_Click(object sender, EventArgs e). That object I create seems to be accessible only within that method, how do I make it accessible to the whole application, just like I have access to mytextbox.text throughout my tabbed...
112
5486
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 that may print some messages. foo(...) { if (!silent)
1
47492
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
5
2115
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 another table I will need later in my form. I have created a reference table called Ref_Table (holds my table names - using this as the tables with the orginal data changes from project to project), I have another reference table called Ref_Fields...
0
9529
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10231
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10013
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9054
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6792
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4119
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.