Results 1 to 7 of 7

Thread: How to make a file using a input box?

  1. #1

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Resolved How to make a file using a input box?

    Hi, all
    I need hlep makeing a file using a input box?
    Exp you Enter Your name as bob the file will be bob.pos
    Last edited by bob5731; Jun 12th, 2005 at 01:39 AM.
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  2. #2
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: How to make a file using a input box?

    this is exactly what you asked for:

    VB Code:
    1. Private Sub Form_Load()
    2. Dim inpStr As String
    3. Dim ff As String
    4.     inpStr = InputBox("Name")
    5.         ff = FreeFile
    6.         Open App.Path & "\" & inpStr & ".pos" For Output As #ff
    7.             Print #ff, inpStr
    8.         Close #ff
    9. End Sub

  3. #3
    Frenzied Member Inuyasha1782's Avatar
    Join Date
    May 2005
    Location
    California, USA
    Posts
    1,035

    Re: How to make a file using a input box?

    *Edit* Beat me to it. Mine was missing a part anways. I forgot to have the "\" to it.

  4. #4

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: How to make a file using a input box?

    a inputbox will not work it need to be text box.
    Last edited by bob5731; Jun 12th, 2005 at 01:09 AM.
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  5. #5
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: How to make a file using a input box?

    same idea..

    Private Sub Form_Load()
    Dim ff As String
    ff = FreeFile
    Open App.Path & "\" & text1.text & ".pos" For Output As #ff
    Print #ff, text1.text
    Close #ff
    End Sub

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: How to make a file using a input box?

    What good is the contents being the same as the name. You have to explain what you are trying to do if you want help. What is going to be IN the file.

  7. #7
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: How to make a file using a input box?

    a inputbox

    by the way, inputbox takes an and not a

Posting Permissions

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



Click Here to Expand Forum to Full Width