473,387 Members | 1,745 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,387 software developers and data experts.

How to delete Data Item from the Combo box permanently

Hi Everybody,
I'm using VB to create a stand alone application.
I want to delete some data item from Combo box & List Box.
I've done this.
When I try to delete any data item from the combo or List box, its deleting.
But the problem is when I re-open the same application the deleted item is also displaying in the list box & combo box. But I don't want it to be like that.
How ever this application was not connected to Database.
The list present in the Combo box are added at the Design time.

Could anybody help me please....?

Thanks & regards,
Prem
Mar 28 '09 #1
13 4288
EYE4U
75
Its because you are not deleting the item from the source of list where list and combo boxes are populating, or from the code.

You need to use either filing or database or you can use windows registry to do this otherwise the way you are using is impossible to delete some item permanently. :)

Regards
ARUZ
Mar 29 '09 #2
debasisdas
8,127 Expert 4TB
What is the source of data for Combo box & List Box.

is that being populated from database ? or hard coded ?

if that the case you need to delete from database as well while deleting from the control.

if hard coded need to modify the code.
Mar 30 '09 #3
@debasisdas
I directly provided values to Listbox & Combo box @ design time. Not using code or Database. Because these boxes contains only few data items. (around 8 to 10).
ThanQ for showing interest sir.

Please reply me.
Mar 30 '09 #4
EYE4U
75
You are hardcoding the items. Save all items in a file and at runtime populate your control from that file...
Mar 30 '09 #5
@EYE4U
Yes, Please tell me how to save those items in a NOTEPAD file instead of MS Access & how to retreieve & delete those items.

Please help me..
Mar 31 '09 #6
EYE4U
75
If you dont know File systems it ll be better to use MSAccess instead of using files...
Whatever i ll upload an example...

Regards
ARUZ
Mar 31 '09 #7
@EYE4U
Yes, I was doing the same thing. Anyhow thanks for your kind co-operation.
& if you don't mind, will you please send a sample code for editing data present in DataGrid Control...? I am also using that Datagrid which is connected to Database, but I couldn't find how to edit.
Apr 1 '09 #8
EYE4U
75
I m sorry for replying late.... I was sick actually... :)
In the example i have used fso to save the list..

Regards
ARUZ
Attached Files
File Type: zip app.zip (1.7 KB, 177 views)
Apr 3 '09 #9
ThanQ So much Sir.
Please tell me how to edit data present in DataGrid control which is connected to Access table. Please.
Apr 3 '09 #10
EYE4U
75
You have to enable following properties of Data Grid :
1. Allow Add New : You can add new records
2. Allow Update : You can Update data
3. Allow Delete : You can delete records

Regards
ARUZ
Apr 3 '09 #11
@EYE4U
Sir,
What you have suggested that one I already tried before this. But still I couldn't edit the data & update. I think some adaptor or some other resources/code I need. Will you guide me.. Please...?
Anyhow thanks a lot for your precious time.
Apr 4 '09 #12
EYE4U
75
Copy the app folder in your c drive and then test the application.
Make sure that the path should C;\App\ for the database file.

Regards
ARUZ
Attached Files
File Type: zip App.zip (7.5 KB, 152 views)
Apr 4 '09 #13
@EYE4U
Sir,
ThanQ for your sample code.
But I'm not using ADODC control. Instead directly linked to Datagrid using code. Because it will change according to the Query generated by the user. So I need code to edit data present in DataGrid. Please send me code to do so..

Thanks in advance. Anyhow I'm getting lot of suggestions & help from you.
ThanQ So much...
Apr 11 '09 #14

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

Similar topics

3
by: anita | last post by:
Hi All Can anybody pls help me out with this problem. I have a combo box control which has about 10,000 values in it. These values in the combo box are called from a different table. When i use...
3
by: Bob Darlington | last post by:
Using Access 2002. I have imported one form and two modules from another database, in order to compare code. Having finished the comparison, I cannot delete them. When I press 'Delete', I get a...
2
by: Jeremy Dillinger | last post by:
I have a program setup to pull data from a database. My database table has things such as (category, Item, price, etc.) In my program I want to have multiple list boxes that will have a pull down...
9
by: Kay | last post by:
Hi all, Could you tell me the best way to add a blank item(as first item) in a data binded combo box? Because I think I didn't do it right and it generate an error if the second item(after the...
4
by: Evan | last post by:
I have a data bound combo box. The combo box displays several items (status code descriptions). After the combo box is bound, I want to set the combo box so that the "Draft" status is displayed by...
1
by: Bill | last post by:
Problem: Combo box data disappears from view when a requery is done See "Background" below for details on tables, forms & controls On a form, I want to use the setting of bound combo box C1...
5
by: rn5a | last post by:
The .NET 2.0 documentation states the following: When using a DataSet or DataTable in conjunction with a DataAdapter & a relational data source, use the Delete method of the DataRow to remove...
2
by: jasone | last post by:
Hi, A section of my database allows users to delete items from a table, there is only one collumn in the table, this contains module information(parts of a manufacturing line) due to the lines...
3
by: Max | last post by:
Hello, I made a windows form with a combo box and 4 text boxes. All 5 objects should get their data from a data set which is populated in the form load method. The combo box has item ids. When...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.