Results 1 to 8 of 8

Thread: date organizer

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2004
    Posts
    18

    date organizer

    i'm making an app that basic goes:
    add future date to text1, add info on date to text 2, hit button 1.
    the date entered in text one is added to list1. when an item(date) is selected, the info added for it earlier appears in text3. how can i make the info reappear in text3 when the date is selected in the listbox? i guess i could save the info to a textfile or something. what's the best way? thanks in advance.

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

    Re: date organizer

    If you need the info the next time you run the program, then you need to write a file. There is an excellent topic in the CodeBank on File Basics part 1 and 2.
    You should look into them.

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: date organizer

    Quote Originally Posted by dglienna
    If you need the info the next time you run the program, then you need to write a file. There is an excellent topic in the CodeBank on File Basics part 1 and 2.
    You should look into them.
    You don't necessarily need a file. If you have only a small amount of data you can use the registry or an ini file. If you have a larger amount of data a database may be appropriate but you could alse use a regular file.

    If you want to use the registry see the Use SaveSetting and GetSetting to store and retrieve data from the Registry link in my signature.

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

    Re: date organizer

    looks like some kind of appointment book, and I woudn't want my appointment info cluttering up my registry. It would work, though.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Oct 2004
    Posts
    18

    Re: date organizer

    thank you. i decided to create a new file for each date's note. i then add the date to a list...

    List Box
    * *
    2-28-05
    2-17-05
    3-14-05
    * *

    how do i make the corresponding file open in a textbox by selecting an item from the list?

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

    Re: date organizer

    Here is one link from the codebank. Ask questions if you don't understand, as we'll help you if you get stuck.


    http://www.vbforums.com/showthread.p...ht=file+basics

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Oct 2004
    Posts
    18

    Re: date organizer

    thank you. i'm understanding the file basics. but how do i differentiate between items in a listbox. i want each item to be a shortcut to open the corresponding file. i guess i'm asking for commands or whatever to use with a listbox control. thanks

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

    Re: date organizer

    In the click event, you can use the listindex to determine which item is selected. to get the text for that item, use
    VB Code:
    1. list1.list(list1.listindex)


    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Activate()
    4.   Dim x As Integer
    5.   For x = 0 To List1.ListCount - 1
    6.     Debug.Print List1.List(x)
    7.   Next x
    8. End Sub
    9.  
    10. Private Sub Form_Load()
    11. List1.AddItem "1"
    12. List1.AddItem "2"
    13. List1.AddItem "3"
    14. End Sub

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