Basic VB help

Discussion in 'OT Technology' started by Capi2001, Jul 3, 2003.

  1. Capi2001

    Capi2001 New Member

    Joined:
    Jul 17, 2001
    Messages:
    2,929
    Likes Received:
    0
    Location:
    TDot
    OK guys this is a really basic VB question, but I'm stuck and have no idea.

    I have a text box and I need to find the space inside the box then take the letters to the left of the space and put them in a separate textbox. Then, on the same click, I need to take the letters from the right of the space and put them into a third textbox. This all needs to happen with one click of a command button.


    Thanks, I really suck at this shit.
     
  2. Spiral Out

    Spiral Out Active Member

    Joined:
    Mar 30, 2002
    Messages:
    12,287
    Likes Received:
    0
    Location:
    Florida
    show the code you have so far...
     
  3. Capi2001

    Capi2001 New Member

    Joined:
    Jul 17, 2001
    Messages:
    2,929
    Likes Received:
    0
    Location:
    TDot
    I have no code so far, I dont even know where to begin
     
  4. Capi2001

    Capi2001 New Member

    Joined:
    Jul 17, 2001
    Messages:
    2,929
    Likes Received:
    0
    Location:
    TDot
    anyone?
     
  5. VBGOD

    VBGOD Guest

    Whooah?

    Well, to find a space..
    Dim seeker As Integer
    seeker = InStr(text1.text, " ")


    The variable seeker is a number. If it's zero, then it found nothing. If it's... say 10, then there is space on the 10th position.

    This is too easy. VB 6 or VB .NET?
     
  6. Capi2001

    Capi2001 New Member

    Joined:
    Jul 17, 2001
    Messages:
    2,929
    Likes Received:
    0
    Location:
    TDot
    vb6, OK it found the space, thanks.

    1 more for you, how do I take the letters from before and after the space and put them into there own text boxes?
     
  7. VBGOD

    VBGOD Guest

    Let's say this is the default text "This is a cool way of doing something."

    How would you like to see this in the end?

    1) s in the left textbox, and s in the right textbox?
    2) y in the left textbox, and t in the right textbox?
     
  8. VBGOD

    VBGOD Guest

    Bah.. I'll just do it. Give me 2 minutes.
     
  9. Capi2001

    Capi2001 New Member

    Joined:
    Jul 17, 2001
    Messages:
    2,929
    Likes Received:
    0
    Location:
    TDot
    Well, what is supposed to happen is the user puts in their full name in the first text box, then they hit a command button, and the program is supposed to take their first name and put it into a box then take the last name and put it into a separate box
     
  10. VBGOD

    VBGOD Guest

    Jesus Christ. Make up your mind. Does this split the names, or characters? There is a difference.
     
  11. Capi2001

    Capi2001 New Member

    Joined:
    Jul 17, 2001
    Messages:
    2,929
    Likes Received:
    0
    Location:
    TDot
    sorry it splits the names.
     
  12. Moongerm

    Moongerm Guest

    if you have a job that has you working with vb, what the hell do you program?
     
  13. Capi2001

    Capi2001 New Member

    Joined:
    Jul 17, 2001
    Messages:
    2,929
    Likes Received:
    0
    Location:
    TDot
    its for night school :(
     
  14. VBGOD

    VBGOD Guest

  15. VBGOD

    VBGOD Guest

    Tell me.. is the text box just the full name?

    [Herb Meehan]
     
  16. VBGOD

    VBGOD Guest

    Code:
    'Declare local variables
    Dim Position As Integer
    Dim ActualPosition As Integer
    Dim i As Integer
    
    'Prepare textbox
    Text1.Text = Trim(Text1.Text)
    TextLeft.Text = ""
    TextRight.Text = ""
    
        'Find the space.
        Position = InStr(Text1.Text, " ")
        
        If Position > 0 Then
            TextLeft.Text = Mid(Text1.Text, 1, Position)
            TextRight.Text = Mid(Text1.Text, Position, Len(Text1.Text))
        End If
    
     
    Last edited by a moderator: Jul 3, 2003
  17. VBGOD

    VBGOD Guest

    A+
    100%
     
  18. VBGOD

    VBGOD Guest

    Do you understand it?
     
  19. Capi2001

    Capi2001 New Member

    Joined:
    Jul 17, 2001
    Messages:
    2,929
    Likes Received:
    0
    Location:
    TDot
    no, we haven't got to loops yet, but ill give it a try, thanks for the hand
     
  20. VBGOD

    VBGOD Guest

    Don't look at that one!!!! It's this you need.

     
  21. Capi2001

    Capi2001 New Member

    Joined:
    Jul 17, 2001
    Messages:
    2,929
    Likes Received:
    0
    Location:
    TDot
    doesn't work:(
     
  22. Early Apex

    Early Apex Guest

    OK, you'll need a DB server, an application server (preferrably running MTS), and a web server. Create a DCOM exe with space, firstname, and lastname objects. Make the appropriate interfaces for your class objects. Compile the DCOM middle tier, run dcomcnfg to register it, and set up the stubs on the webserver. Create your DB with space, first_name, and last_name tables (be sure you've got indexes set correctly).

    Now, ADO would be too easy, so we're going to use RDO for data access. And we're going to do it through the VB DED because we like a challenge. Yes, I know, DED doesn't support RDO or DAO, but anything can be accomplished if you know the Win32 API.

    Set up remote debugging on the web server (this will take a few weeks). Make sure you've got everything accounted for in SourceSafe -- careful with the versioning! -- and you're ready to go.
     
  23. Capi2001

    Capi2001 New Member

    Joined:
    Jul 17, 2001
    Messages:
    2,929
    Likes Received:
    0
    Location:
    TDot
    hmmmmm NO!
     
  24. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    VBGOD's code puts a space in both boxes, not to mention variables declared and not used!

    [Nelson]HA HA![/Nelson]
     
  25. VBGOD

    VBGOD Guest

Share This Page