Check Boxes: Writing Results to Text File and Formatting Properly
Hello, everyone. This is my first post, and I'm a novice. I'm using Visual Basic 6, running on Windows 7 32-bit.
I need help with check boxes, please. I've written a rudimentary program that does nothing more than let me type text into a few text boxes, click a button, and have that text stored in a file.
Right now, the form has just a few text boxes, and a command button to generate the file. It works.
I'm going to complicate the project by adding a group of check boxes. I've only now just begun to research check boxes, but I haven't figured out how to get all of the checked options to be displayed on one line, separated by commas.
To elaborate:
Just for demonstration, let's say I have six check boxes in a check box group named HOBBIES. The six choices are:
1. Bicycling
2. Painting
3. Cooking
4. Dining Out
5. Strength Training
6. Playing Saxophone
Let's say someone selects the following three options:
Painting
Dining Out
Playing Saxophone
I'd like the line in the text file to be displayed like this, including the header:
Hobbies: Painting, Dining Out, Playing Saxophone
Is this possible?
Also, to make the procedure even more complicated, I want to have TWO separate lines of text for HOBBIES, only if four or more items are selected.
Example: If the following five options are selected:
1. Bicycling
2. Painting
3. Cooking
4. Dining Out
5. Strength Training
Then the program should put the following two lines in the text file, formatted thusly (double-spaced):
Hobbies: Bicycling, Painting, Cooking
Hobbies: Dining Out, Strength Training
Being a novice, I'm wondering if I'm making this too complicated. On the other hand, it's a reasonable challenge that hopefully will improve my coding skills.
Without actually providing me with code, what would be the best way to proceed with this goal?
Thank you to anyone and everyone who'd be kind enough to assist. Jack D.
|