If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Get an input on one form to input code in another

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-25-04, 13:41
jwman jwman is offline
Registered User
 
Join Date: Aug 2004
Posts: 82
Exclamation Get an input on one form to input code in another

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
Reply With Quote
  #2 (permalink)  
Old 08-26-04, 10:29
Marvels Marvels is offline
Registered User
 
Join Date: Jul 2003
Location: Amsterdam, Nederland
Posts: 449
Cool 2 possible solutions

1
Add a class to your project
declare the folowing

Global GblName As String
Global GblPssw As String

Now in your Registration Form you set the code under your button
if txtUser <>"" then
GblName =txtUser.text
else
msgbox "Please enter name",vbokonly +vbinformation
endif

if txtpssw <>"" then
GblPssw =txtpssw.text
else
msgbox "Please enter Password",vbokonly + vbinformation
endif

Now if thats done in you secondform Login Form
in the form load you set
me.txtuser =GblUser
me.txtPassw = GblPssw

2
i see that u hide the first form so you can allways call the controls on that form
So if Registration Form is the first 1 and you hide it and you want to put info off the first into the 2nd
all you have to do is in the form load of the 2nd form
Form2.txtName.text = Form1.txtName.text
Form2.txtPssw.text = Form1.txtPssw.text

Note where I write Form1 and Form2 write the actual name of the Form so i think frmRegistration.txtName.text =frmLogin.txtName.text


Good luck
Reply With Quote
  #3 (permalink)  
Old 08-26-04, 12:52
jwman jwman is offline
Registered User
 
Join Date: Aug 2004
Posts: 82
thanx

the title says it all
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On