473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

add/edit/delete item on a listbox

hi!

I have a list box with three columns and then three command buttons, add/edit/delete,. I've worked out for the code, but it's not working, maybe because my row source type is set to a table/query instead of value list. Is there any way that i can do those buttons functional for a row source type set to a table/query? Please help me T_T
Jan 2 '13 #1
3 4011
Seth Schrock
2,965 Expert 2GB
I have never tried doing this, but here is what I would look into. In the On_Click event you will need to open the recordsource for your list box. This is done with the following code:
Expand|Select|Wrap|Line Numbers
  1. Dim db as DAO.Database
  2. Dim rstListBox as DAO.Recordset
  3. Set rstListBox = db.OpenRecordset(The row source of your listbox)
You would then use the .AddNew, .Edit, or .Delete methods depending on which button you click. The .Edit and .Delete methods would have to use the selection in the listbox as the criteria for a rstListBox.FindFirst method so that you could find the appropriate record and then either edit it or delete it.
Jan 2 '13 #2
zmbd
5,501 Expert Mod 4TB
Respectfully, Bytes is not a code nor homework service. Your post is subject to being removed because asking for someone to provide completed code or a completed project is against site policy - even if someone has already offered a solution. Please consult the FAQ and specific forum sticky threads for further information.

You need to provide your code/work and the exact title/error-number/error-text for all error messages received.
Jan 2 '13 #3
NeoPa
32,556 Expert Mod 16PB
If your row source type is Table/Query then all you can do to effect the list shown (short of changing the data in the table of course) is to change the filtering of the data. IE. Change the query, or change to a query if using a table.
Jan 3 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Qnavry | last post by:
I am creating one page to edit, delete, and add data to a database. The Add code works but the Edit and Delete do not. What am I doing wrong? If you need more code let me know. Thanks Code:...
4
by: Smudger | last post by:
I've succesfully connected my MS Access Database to my .NET app and can view / navigate records. What I would like to do now though is perform add, edit & delete functions on these records is...
1
by: Andy | last post by:
I am trying to edit a item in a form..... On the form it looks like Change it < > and I want the user to add the information inbetween the < > so it will end looking something like this...
6
by: Stanley | last post by:
Hi all! I have problem trying to edit the item in listview. When I set LabelEdit to True, I can only edit the first column's item. How about editing another column's item?? Thanks in advance! ...
12
by: dennist685 | last post by:
Can't edit, delete or add row in an Access database in a website 2003 When I implement a walkthrough using Northwind I have no trouble doing this. Also, in a windowsforms project I have no...
0
by: TT | last post by:
Hello. I'm working in asp.net and i need to disable the edit/delete functionality from a frmview component. help me.thang you! my ACL sub: Protected Sub Page_Load(ByVal sender As Object,...
2
by: =?Utf-8?B?SWJyYWhpbS4=?= | last post by:
Hello, I have a client c# application from which I want to Add/Edit/Delete & list records by connecting to Web Service. HOw can I write classes & methods in Web service projet that will : ...
1
by: haringmunti | last post by:
hi, how do you add, edit or delete item using vb.net? sad to say, all i know how to do at the moment is pick the command button from the toolbox and then label it properly. im trying to make a...
8
by: Ratko | last post by:
Say you have something like this: for item in myList: del item Would this actually delete the item from the list or just decrement the reference counter because the item in myList is not...
3
by: 125a29 | last post by:
hi i'm trying to update total order cost in order table , basically what i want when i edit order item table such as changing quantity then it automatically update the total cost in order table i...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.