 |
|
 |
|
Next: Inner Join vs Cartesian Product?
|
| Author |
Message |
External

Since: Jun 03, 2004 Posts: 1
|
(Msg. 1) Posted: Thu Jun 03, 2004 9:18 pm
Post subject: Which control, and how to work with the multiple values sele Archived from groups: microsoft>public>vb>database (more info?)
|
|
|
Hi all,
I'm a newbie to VB, trying to transfer over my VBA/Access skills. I'm
trying to set up two listboxes/datagrids (not sure which control to
use), each with two columns. The controls will be used to select one
or several values in each case. The first control ("choose one or
many companies") will filter the data in the second control (so that
you only see leases for those companies chosen). Once the user has
chosen one or several leases from the second control, those values
will be used to build a SQL statement for a recordset that I'll run a
Crystal Report on. So, my questions are these:
1. Which control should I use? I originally thought of a listbox
with two columns, but apparently they don't work in VB the same way
they do in VBA/Access, and a datagrid or datalist (or DBList?) is the
way to go. Is this right? Which one is best for this job?
2. How do I collect the primary key or bound column of the first
control's selected row so I can filter the second control if there
isn't a property like "SelectedItem"? I don't see a property that
looks likely when I use the Object Browser for a datagrid...
3. I think if I knew how to solve #2, then I would understand how to
collect the one or several values indicated in the second control to
use with my recordset. Does this sound right? If not, how would I do
it?
Thanks so much for your help. >> Stay informed about: Which control, and how to work with the multiple values se.. |
|
| Back to top |
|
 |  |
External

Since: Apr 20, 2004 Posts: 21
|
(Msg. 2) Posted: Fri Jun 04, 2004 3:14 pm
Post subject: Re: Which control, and how to work with the multiple values [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
First, the choice of control is a purely pragmatic one, according to user
functionality: what do you actually want the users to see and be able to do?
For the list controls (listbox, combobox), you can put the record IDs in the
ItemData() property. Use the ListIndex property or Selected() array to check
which items have been selected.
For the grid controls, you can put the IDs in the RowData() property. Check
what's selected by looking at the .Row and .RowSel properties.
"Robin" wrote in message
> Hi all,
>
> I'm a newbie to VB, trying to transfer over my VBA/Access skills. I'm
> trying to set up two listboxes/datagrids (not sure which control to
> use), each with two columns. The controls will be used to select one
> or several values in each case. The first control ("choose one or
> many companies") will filter the data in the second control (so that
> you only see leases for those companies chosen). Once the user has
> chosen one or several leases from the second control, those values
> will be used to build a SQL statement for a recordset that I'll run a
> Crystal Report on. So, my questions are these:
>
> 1. Which control should I use? I originally thought of a listbox
> with two columns, but apparently they don't work in VB the same way
> they do in VBA/Access, and a datagrid or datalist (or DBList?) is the
> way to go. Is this right? Which one is best for this job?
>
> 2. How do I collect the primary key or bound column of the first
> control's selected row so I can filter the second control if there
> isn't a property like "SelectedItem"? I don't see a property that
> looks likely when I use the Object Browser for a datagrid...
>
> 3. I think if I knew how to solve #2, then I would understand how to
> collect the one or several values indicated in the second control to
> use with my recordset. Does this sound right? If not, how would I do
> it?
>
> Thanks so much for your help. >> Stay informed about: Which control, and how to work with the multiple values se.. |
|
| Back to top |
|
 |  |
External

Since: Sep 29, 2003 Posts: 13
|
(Msg. 3) Posted: Mon Jun 07, 2004 3:12 pm
Post subject: Re: Which control, and how to work with the multiple values [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
How about using a treeview with checkboxes?
Company1
--> Lease1
--> Lease2
--> Lease3
Company2
.......Lease1
....etc.
This would show the relationship between the companies and their leases.
when the user checks a company the child leases are also checked.
Use the Nodes 'Key' or 'Tag' property to store ID information and proof the
Node.Checked property to get the selected items.
hth,
Dave
"Robin" wrote in message
> Hi all,
>
> I'm a newbie to VB, trying to transfer over my VBA/Access skills. I'm
> trying to set up two listboxes/datagrids (not sure which control to
> use), each with two columns. The controls will be used to select one
> or several values in each case. The first control ("choose one or
> many companies") will filter the data in the second control (so that
> you only see leases for those companies chosen). Once the user has
> chosen one or several leases from the second control, those values
> will be used to build a SQL statement for a recordset that I'll run a
> Crystal Report on. So, my questions are these:
>
> 1. Which control should I use? I originally thought of a listbox
> with two columns, but apparently they don't work in VB the same way
> they do in VBA/Access, and a datagrid or datalist (or DBList?) is the
> way to go. Is this right? Which one is best for this job?
>
> 2. How do I collect the primary key or bound column of the first
> control's selected row so I can filter the second control if there
> isn't a property like "SelectedItem"? I don't see a property that
> looks likely when I use the Object Browser for a datagrid...
>
> 3. I think if I knew how to solve #2, then I would understand how to
> collect the one or several values indicated in the second control to
> use with my recordset. Does this sound right? If not, how would I do
> it?
>
> Thanks so much for your help. >> Stay informed about: Which control, and how to work with the multiple values se.. |
|
| Back to top |
|
 |  |
| Related Topics: | sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table "PriceList" and there a column "Pricemk" wich is data type "money". All data in this column is in form "10001,35". So why when...
arrays - is there a way to concatenate the contents of an array (looping through the array) and storing each item in a comma delimited string? Thanks!
DataReport PageBreak - Hi everyone, I would like to know how to force pagebreak in a datareport for example after 5 records printed. Thank you all
Possible Use of a Cursor - I have a complex query that I hope I can explain it well enough for everyone to understand. I have a table that contains information for work instructions. Contained in the table are "MACHINE_PROC" these are groupings of machining processes....
Scroll Bars - Is there a way to find the size of scrollbars on a system using Visual Basic 6.0? I know how to look and change them on the display properties, but I don't know how to access that information from within Visual Basic. |
|
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum
|
|
|
|
 |
|
|