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

Please Help - Combo Box Question...

Dear Access Users,

I have a form with a combo box and a button on it. The combo box has
a list of all the records in the database. When the user pushes the
button, a macro runs that deletes the record (which is made up of
several tables) from the database. No sweat! The problem: The owner
of this database has requested that several hundred records be
deleted. I can very easily change the query that powers the combo box
so that it only lists a certain year's records.

Is there any way when the button is pressed, that code will start at
the first record listed in the pull down and work down to the next and
the next and so on until all of the records listed are deleted? If I
need to change it to a list box, no sweat.

Thanks a million in advance!

Kevin
Nov 13 '05 #1
1 1353
No Spam wrote:
Dear Access Users,

I have a form with a combo box and a button on it. The combo box has
a list of all the records in the database. When the user pushes the
button, a macro runs that deletes the record (which is made up of
several tables) from the database. No sweat! The problem: The owner
of this database has requested that several hundred records be
deleted. I can very easily change the query that powers the combo box
so that it only lists a certain year's records.

Is there any way when the button is pressed, that code will start at
the first record listed in the pull down and work down to the next and
the next and so on until all of the records listed are deleted? If I
need to change it to a list box, no sweat.

Thanks a million in advance!

Kevin


This routine might give you some further insight into combos. Create a
new form and create a new combo that uses a small table of 20 records or
less (so you can see/verify the results). Call the combo Combo0.

Copy the code below into the event.

I'll assume the first column is the key. Change the col value of what
you want to see where I make reference to Column.

Try it with column headings on and headings off.

Private Sub Combo0_Click()
Dim lngCnt As Long
Dim intFor As Long
lngCnt = Me.Combo0.ListCount - 1
Dim strVar As String
For intFor = lngCnt To 0 + Abs(Me.Combo0.ColumnHeads) Step -1
'change Column(1, to another column if you like
strVar = strVar & Me.Combo0.ItemData(intFor) & " " & _
Me.Combo0.Column(1, intFor) & vbNewLine
Next
MsgBox strVar

End Sub
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
5
by: J. Yuan | last post by:
Hi, I am working on a checkout/inventory system. How can I make a button that when pressed, would update the previous fields transaction number to a table (for example, -3 printers, so that...
2
by: Abdul Waheed | last post by:
Please help me dear brothers . i want to design a database which is for a survey. it has a shape like this. surveyeeid Gender MotherTonge Question 1 Options(Combo Box)
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
14
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ;...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
22
by: KitKat | last post by:
I need to get this to go to each folders: Cam 1, Cam 2, Cam 4, Cam 6, Cam 7, and Cam 8. Well it does that but it also needs to change the file name to the same folder where the file is being...
1
by: Shawn Yates | last post by:
It has been a while since I have done anything on MS Access and I seem to be a bit rusty. I hope someone could help me solve my issue. I have a form that has multiple combo boxes on it. Each box...
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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.