Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the info on multiple forms through public declaration

Status
Not open for further replies.

dsmart16

IS-IT--Management
Joined
Nov 30, 2004
Messages
12
Location
CA
Help,

Hi there, I'm having difficulty figuring this one out.

Here's what I'm trying to do, I have the opening form (frmLogon). Now the user will enter in their username into (txtUsername) and their password into (txtPassword).

Then the user clicks on (cmdLogon). When clicked, my code verifies that the username and password match up with a table (tblLogon). Another field on the table is UserType. There are 3 types of users (FullControl, FormsReports, ReportsOnly). Each Username and Password are assigned one of the 3 usertypes.

Once the Username and Password is confirmed to match the table, I have the code tell me what the UserType is. I then assign the result to (stUserType), which I declared

Public stUserType as String

The code then opens the second form (frmSurveillance). Then based on what the stUserType is from frmLogon different command buttons will appear on frmSurveillance.

Where the problem lies is once I move on to the second form (frmSurveillance) or the third form (frmBird) the database doesn't know what the stUserType is.

What do I do in order to store the UserType in the (cmdLogon) and how do I use it on the other forms such as (frmSurveillance or frmBird)?

Any help would be greatly appreciated, thanks
Dave
 
(i]Public stUserType as String[/i]
The above declaration must be in a standard code module declarations section, not in a form module.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thank you for your response, I'm just not sure where to find the 'standard code module'. It appears to me that anytime I try to enter in code I am on one of my forms.

Thanks,
Dave
 
When in VBE (Alt+F11), menu Insert -> Module

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top