|
-
April 18th, 2002, 12:31 AM
#1
Opinion for Checkbox?
Hi all VB Guru here,
I would like to get you opinion on doing this:
1. What i would like to do is, i will load a data from the Access database into the Program, then i should able to select a certain record from the list, (like using the checkbox) then save dit back to the database.
2. My question is, which components is better and suitable for this purpose? I'm thinking of listbox, mshflexgrid (look like cannot have checkbox there?), datagrid? There is no editing on the record, but should be able to know what is the records selected when saving back to the database.
Hope can get some valuable suggestion from you people.
Thanks a lot.
-
April 18th, 2002, 12:58 AM
#2
Re: Opinion for Checkbox?
Hi there
If you should show only the text in the cells, why you considering the datagrid and so on ? Use plain and simple listbox, if you haven't any special requirements. There is no doubt !
-
April 18th, 2002, 01:19 AM
#3
Re: Opinion for Checkbox?
Hi, thanks for reply.
I'm have try to use listbox to load the data. This is the coding:
Do While Not .EOF
List1.AddItem .Fields("No") & " " & .Fields("Name")
.MoveNext
Loop
The problem is, how can i save it back to the database by comparing to the No field?
May be u can help on this.
-
April 18th, 2002, 01:44 AM
#4
Re: Opinion for Checkbox?
Hi there,I hope i have understood ur problem .
What i suggest is u fill the flexgrid with the data but start filling from 2ndcolumn and leave the first column blank.
Now after u have filled the data.U set the Font of first col. to 'Marlett' and on click or space bar press set the content of first column to 'a'or 'A' this will give u a look of checkmark.
Or as a second option u can use listview it has a functionality of check box and also allows u to get the value of individual columns.
Hope it helps.
-
April 18th, 2002, 01:45 AM
#5
Re: Opinion for Checkbox?
Instead of the usage of the ListBox, better use the ListView component from the Microsoft Windows Common Controls 6.0, because ListBox are very limited component. To do this, select meny Project->Components and check the checkbox in the list near this name (MS Windows Common controls 6.0) and click ok. Now you have new controls in the Toolbox.
Ok. There is solution :
Set Checkboxes and multiselect properties to the true. Fill the rows with data. Let user check the checkboxes near the items, that should stay in database, and when user click ok, you should check each checkbox, and delete item from database, if the checkbox is not checked.
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
|