Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    82

    Exclamation Unanswered: 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

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    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

  3. #3
    Join Date
    Aug 2004
    Posts
    82

    thanx

    the title says it all

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •