473,586 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamic generation on Combobox values

2 New Member
I am trying to have the last 12 months to always be the option in the dropdown for a combo box. (Basically a combobox, with dynamic options)

I am using Access 2000.

What is the function and syntax in visual basic to edit a combobox? I can do all the dynamic month generation, but I do not know how to edit a combobox from VB.

Thank you.
Feb 7 '07 #1
3 3207
Rabbit
12,516 Recognized Expert Moderator MVP
If you're talking about the list for a combo box then it's Me.ComboBoxName .RecordSource
Feb 7 '07 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
I am trying to have the last 12 months to always be the option in the dropdown for a combo box. (Basically a combobox, with dynamic options)

I am using Access 2000.

What is the function and syntax in visual basic to edit a combobox? I can do all the dynamic month generation, but I do not know how to edit a combobox from VB.

Thank you.
The code is ...

Expand|Select|Wrap|Line Numbers
  1. Me.ComboBoxName.RowSourceType = "Table/Query"
  2. Me.ComboBoxName.RowSource = "SELECT ...."
  3. Me.ComboBoxName.Requery
Or

Expand|Select|Wrap|Line Numbers
  1. Me.ComboBoxName.RowSourceType = "Value List"
  2. Me.ComboBoxName.RowSource = value1;value2;...etc.
  3. Me.ComboBoxName.Requery
Triggering this code could be done on the Form Load event if no action on the form is going to affect it. If it's on the form load event you won't need the requery.

Mary
Feb 8 '07 #3
fedya
2 New Member
Thats it thanks.
Feb 8 '07 #4

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

Similar topics

4
5023
by: Martin Mrazek | last post by:
Hi, I have a HTML form and need to generate the action-string (what to do after submission) from values of textfields in the form. It means something like <form method="post" action=whatToDo.value> <input name="whatToDo" value="http:\www.myPage.com\cgi-bin\DoDefault"> .... </form>
1
2036
by: Stephen.Hunter | last post by:
Hello Everybody (anybody)? I am trying to appent a combobox to include data entered by a user which is Not In List. I have came accross this code from Allen Browne which seems to be what I am looking for can anybody tell me if I have to change any of the code below to match field names or combobox name from my own database. Thanks in...
5
4509
by: Markus Broy | last post by:
Hello everybody, I have a problem concerning the dynamic creation of a CustomValidator. If I create a CustomControl as shown in the code below and the page is post back the validation procedure is never called. In Page_Load Page Validate() is called and in the control which should be validated there is a non numeric value.
1
1601
by: Kevin Hodgson | last post by:
I have a DataBound ComboBox, which has a text value as the Value property, and the UniqueID for that value is bound to the Combobox.Tag property. When a user makes a new selection in the combobox, I need to run a SQL Query with the UniqueID of the new value they are picking. The .SelectedIndexChanged and .SelectedValueChanged events give...
1
3482
by: Thomas Qvist | last post by:
We are building a suite of programs consisting of both winforms applications and office addins. We would like to pre-generate the xml-serialization classes and add it to our project to avoid the overhead at startup and thus enhance the performance of our applications. The programs are coded in c# under .net 1.1.
6
18549
by: R2d2Rabeau | last post by:
Hi, I have a comboBox that controls a datagridview. I would like to know how I can make the values displayed in the combobox unique (distinct)? Thank you for your help,
1
8048
by: The.Daryl.Lu | last post by:
Hi, two parts to my problem if someone can help address either one or both: 1. I want to SELECT everything in the table if it matches the criteria when the query button is pressed (this is just a commandbutton on my form). The biggest problem I'm having is that I can't (don't know how) populate a combobox on static items such as "True,...
0
874
by: J. Cliff Dyer | last post by:
On Thu, 2008-05-08 at 10:33 -0500, Victor Subervi wrote: Why are you dynamically creating getpic20.py? Obviously, in the real script, you probably have several of them: getpic1.py, getpic2.py, etc., but is there any reason you couldn't just have one getpic.py, and pass the number in as a parameter in your GET request, like this: ...
14
6539
by: Mark | last post by:
I have a table with a field that uses a combobox to populate values. The Lookup tab within table design mode is the following: Display Control Combo Box Row Source Type Table/Query Row Source SELECT .LastName, .FirstName, .EmployeeNumber FROM ; Bound Column 3 Column Count 3...
0
7912
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8202
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8216
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1449
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.