|
-
Feb 28th, 2005, 07:53 PM
#1
Thread Starter
Junior Member
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.
-
Feb 28th, 2005, 09:20 PM
#2
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.
-
Feb 28th, 2005, 09:31 PM
#3
Re: date organizer
 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.
-
Feb 28th, 2005, 09:39 PM
#4
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.
-
Feb 28th, 2005, 10:31 PM
#5
Thread Starter
Junior Member
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?
-
Feb 28th, 2005, 10:36 PM
#6
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
-
Feb 28th, 2005, 10:46 PM
#7
Thread Starter
Junior Member
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
-
Feb 28th, 2005, 11:12 PM
#8
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:
list1.list(list1.listindex)
VB Code:
Option Explicit
Private Sub Form_Activate()
Dim x As Integer
For x = 0 To List1.ListCount - 1
Debug.Print List1.List(x)
Next x
End Sub
Private Sub Form_Load()
List1.AddItem "1"
List1.AddItem "2"
List1.AddItem "3"
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|