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

Fill ComboBox using VBA

20
Hi, every one

I have a combobox called "Me.Cuadro_combinado17" in ACCESS 2003

How can I add a list via VBA

I need to fill it with the next list

"Cat"
"Dog"
"Fish"

How can I do it?
Feb 12 '10 #1
4 2363
mshmyob
904 Expert 512MB
Basically set your RowSource property for the combo box:

Simplified version like so

Expand|Select|Wrap|Line Numbers
  1. Dim strRowSource as String
  2.  
  3. strRowSource = "Cat;Dog;Fish"
  4. Me.Cuadro_combinado17.RowSource = strRowSource
  5. Me.Cuadro_combinado17.Requery
  6.  
  7.  
cheers,
Feb 12 '10 #2
cynicon
20
Thank you so much it works perfect
Feb 15 '10 #3
mshmyob
904 Expert 512MB
You're welcome.

cheers
Feb 15 '10 #4
beacon
579 512MB
Personally, I would prefer to use a table for values like you listed cynicon and then write a SQL statement that populates the combobox using mshmyob's method.

This prevents you from having to hard code the values, which I've always been taught to avoid if at all possible.
Feb 15 '10 #5

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

Similar topics

8
by: Pepehammer | last post by:
Hi everybody! I got a combobox to fill. I want to display some information (Text), but when I select a item, I want to return a number. The info I want to fill in is something like this: ...
1
by: Ari | last post by:
Hi I hope some body can help me. I'm new with Visual Basic .net. I'm trying to fill a DataSet from to combo box but i do not how to do and i do not find any information that expalin to me how to...
1
by: Maurice Mertens | last post by:
Does anyone know how to get an auto-filling combobox on a form? When I add a combobox to a form I can set the DropDownStyle property to DropDownList. This will make the combobox auto-filling. But...
3
by: Maurice Mertens | last post by:
Hi all, In VB.NET you can set the DropDownStyle for a combobox to 'DropDown' or 'DropDownList'. When you set it to DropDownList, it supports auto-fill. But when you set it to 'DropDown', the...
2
by: ken | last post by:
I would like to fill a combobox with the values of one column of the dataview I am using. When I set it up the way I expect it would be, I get every row in the combobox says: ...
7
by: sparkle | last post by:
Hi Everybody, I'm filling a combobox from a class, which works fine on it's own. But when I insert code to fill in other controls something in the combobox fill is causing the...
6
by: Sakharam Phapale | last post by:
Hi All, How to fill one ComboBox from other ComboBox control? 1) Only setting the reference does the trick but doesn't show items in control. If you see in immediate window, it shows...
3
by: Magnus | last post by:
Im using a set combobox (ComboBox1) to provide a selection of records from a database table. I have a typed dataset (DataSet1) that contains the typed datatable (DataTable1) that the combobox is...
5
by: Tark Siala | last post by:
hi dear i'm programmer with VB6, but now i starting with C#. first problem is coming when i need fill "ComboBox Control", as you know when i fill combobox in VB6 by this code: comboX.AddItem...
1
by: menyki | last post by:
am still finding it difficult as a new java user. am designing a software that has multiple forms, controls such as combobox and so on and finding it difficult to do the following. i want some...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.