|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
Hi, I'm a complete newbie to VB code but seem to be getting the jist of it.
Well the problem is really I don't know if some things are actually possible what i want to do is: When someone imputs text into text boxes in a form (The Registration Form) it automatically adds the following code (into the Login Form): elseif "USERNAME BOX ON REGISTRATION FORM" = "TEXT IN TXTUSERNAME IN REGISTRATION FORM" and "PASSWORD BOX ON REG FORM" = "TEXT IN TXTPASS IN REG FORM" then Login.Hide Main_Menu.Show SORRY if this is too confusing because I have a habit of just writing knowing that I understand it but not realising others might not understand. But all i want to achieve is for text in one form to be put into a template on another form but I don't know if it's possible. Thanx ![]() |
|
#2
|
|||
|
|||
|
Hi,
What you scetch is not possible in VB. Self-modifing code is something that is pretty damn hard in any language (although it is possible, just write up a routine that outputs itself to another file with modifications and let it compile, then spawn the new executable. This is the very basic setup). What I figure what you want is a simple mechanism to present a login form and only allow certain people to use the application. From this point you must make some decisions:
Code:
Select case frmLogin.txtUsername.text Case "JohnD" If (frmLogin.txtPassword.text = "Whoisjohndoe") then ' Access Granted Else ' Access denied, shout for help, sound the alarm or nuke his system. End If Case "JaneD" If (frmLogin.txtPassword.text = "MysteryWoman") Then ' Access Granted sweetie.. Else ' Access denied, grab your coat and take her out for coffee. End If End Select Each time you want to give another user access to the application, you need to extend the select case statement. In the long run, you can see the problems with this approach. The list will grow, and in some point of time it will be so large that is becomes harder and harder to maintain. On the other hand, if you provide a database with a users table in it, the code is simple and maintainable. All you need to do is provide procedures on how to add and delete users from the table (nice Administrator screen, etc.) The choice is up to you. Grtz.© M. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Get an imput on one form to write code in another |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|