Hi Cody,
You'll have to explain what you mean by a "userform."
As to your question, one of the first things you'll need to learn about
programming is that what a user sees is not what a programmer sees and works
with. And what looks simple to a user, because it has a simple-looking user
interface, is quite often not at all simple from a programmer's perspective.
There are literally dozens of ways of handling what you're describing, and
what you're talking about is requirements. Requirements are what drives the
development process. What are the requirements for this project? Now, again,
what looks simple to a user looks simple because the user doesn't think
about details. A programmer must think of every detail, and anticipate every
permutation of a problem. So, the first step to take before writing one
scrap of code (as in "I have already created a userform") is to specifically
and completely (as possible) identify the requirements of the application.
What you've described is often referred to in the programmig biz as the
"10,000-foot view" of the requirements. This is what the user thinks about,
and it is the starting point for a developer in terms of defining
requirements. The objective here is to "zoom in" by increments, getting
closer and more detailed with each iteration. Form the 10,000-foot view, you
go to the 5,000-foot view. From there, you identify more specifically what
the requirements are, and begin to flesh in the details, until you're at the
1-millimeter view, which is where you start writing your code, a millimeter
at a time!
Taking your practice app as an example, we need to first identify what KIND
of login is required for this app. For example, a Windows Operating System
is a multi-user system, and you might simply go with that. On the other
hand, multiple users often use the same Windows login (like my wife, who
uses my login on my home machine, mostly because she doesn't know much about
computers). So, you might want to create an application-specific login, such
as you've described.
That said, you need to identify the security requirements for your login.
How secure do you want this information to be? You could store it in an
Access database, but you would have to make sure that the database is
protected with a password that your app can use. You could store it in the
System Registry, but anyone on that machine could get into the System
Registry (possibly) and find out the user name and password. You could use
encryption to store the user names and passwords, and that can be very
secure. Or perhaps you aren't concerned at all about security. Some apps
just don't need much of it.
You also need to think about the network capabilities of the app. Is it
supposed to work on a network? Should users be able to access it from the
network? How about over the Internet? You might want to use an ASP.Net
application to give users access to it from the Internet. And at this point,
you will no doubt need some serious security built in.
As to where to store the user name and password, that again is partially
determined by the network capabilities of the app. If it's a network app,
you will probably want to go with a database server, which can be accessed
from anywhere in the network. Or if it's an ASP.Net app, the only thing that
needs to get to the database is the server-side application itself. And what
sort of database is determined by how much traffic you will expect.
The size of the application is always a consideration. Might it accomodate a
large number of simultaneous users? Might it grow into an app of that size?
So, I hope by now you can see why I said the question is not as simple as
you might have thought. And the answer to the question is not as simple as
you would like. Where can you find a tutorial or something along those lines
that will show you how to properly store user names and passwords as well as
verify them with a button event? Well, at this point, you haven't narrowed
the question down enough to answer.
Let me, if I may, give you a bit of a head start. Before you continue with
this project, download and install the free Microsoft .Net SDK:
http://www.microsoft.com/downloads/...A6-3647-4070-9F41-A333C6B9181D&displaylang=en
It is full of tutorials and Quick Starts to help you learn C# and .Net
programming of all sorts.
And remember, if you want to be a programmer, you'll need to stop thinking
like a user! ;-)
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Big things are made up of
lots of little things.