Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using list box...

Status
Not open for further replies.

GWhiz

Programmer
Dec 16, 1999
49
US
I'm trying to use a list box 'on_click' event to select a record to delete from the recordset that populates the list box.<br>
<br>
Have used Rst.Edit to set up the recordset for changes, Rst.Index to set field to look at, then Rst.Seek to locate the record that matches the ListBox.BoundColumn value, then Rst.Delete and Rst.Update. Then I Requery the list box so that it no longer displays the record that was just (supposedly) deleted.<br>
<br>
Seems like that should work, shouldn't it?<br>
<br>
What am I missing (besides a few marbles)?
 
What you are missing is a GRID <br>
dump that antiquated list box of a grid<br>
the &quot;dbgrid&quot; in VB5 or &quot;Data Grid&quot; in VB6 much better than list box for working directly with recordsets.<br>
It allows editing, adding, deleting, and more than one column.<br>
All without code.<br>
Try it you'll like it.<br>
<br>

 
Tnx for your response, Mr. DougP.<br>
<br>
I understand power/flexibility of using gridbox as opposed to list box, and agree that in many apps grid box is preferable.<br>
<br>
In this app, list box offers 1-step point and shoot convenience (as opposed to 2-step selecting then deleting from grid) -- and am trying to keep steps to absolute minimum for convenience of customer. He has a lot of clicking to do already, so saving even a small step here and there adds up to a LOT of time savings over the next several months or years. In fact, the value of my services as a programmer is directly related to the amount of time I can save him. So I'm trying to make myself as valuable as possible.<br>
<br>
I'm certain there's a way to accomplish what I'm trying to do -- just running into problems doing it!<br>
<br>
One thing I haven't tried -- using a delete query as source of records for list box, then selectively deleting as required. Not sure how that will work, if at all, for selecting and deleting single records. Will try tonite.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top