473,785 Members | 2,969 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Range of numbers for combo-box without using a table?

176 New Member
Hi.

I'm currently dealing with the following:

I need a drop box that will have in it a certain range of accending consuquential numbers for ex: 1, 2, 3, 4, 5, 6, 7. The min and the max number (the range) can be determined by user.

The only way I know of how to do it, is creating a VBA loop with the count of the range of numbers needed and appending each instance of the loop a record to a table, and in this way creating a table with sequentiqal numbers, then using the table as a row source of the query. Is there any other, simplier way?

Thanks in advance, Michael.
Mar 10 '07 #1
4 4764
Rabbit
12,516 Recognized Expert Moderator MVP
A row source can be built using just the values:
Expand|Select|Wrap|Line Numbers
  1. "Value 1"; "Value 2"; "Value 3"
Mar 10 '07 #2
Michael R
176 New Member
A row source can be built using just the values:
Expand|Select|Wrap|Line Numbers
  1. "Value 1"; "Value 2"; "Value 3"
Nope, doesn't work. It says values specified on this form does not exist.
Mar 10 '07 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP
Nope, doesn't work. It says values specified on this form does not exist.
You need to change the rowsourcetype to "Value List".

Mary
Mar 10 '07 #4
ADezii
8,834 Recognized Expert Expert
Hi.

I'm currently dealing with the following:

I need a drop box that will have in it a certain range of accending consuquential numbers for ex: 1, 2, 3, 4, 5, 6, 7. The min and the max number (the range) can be determined by user.

The only way I know of how to do it, is creating a VBA loop with the count of the range of numbers needed and appending each instance of the loop a record to a table, and in this way creating a table with sequentiqal numbers, then using the table as a row source of the query. Is there any other, simplier way?

Thanks in advance, Michael.
As long as you are not running an earlier Version of Access:
Expand|Select|Wrap|Line Numbers
  1. Dim lngMin As Long, lngMax As Long, intCounter As Integer
  2.  
  3. lngMin = 2000        'retrieve value in any manner
  4. lngMax = 2150        'retrieve value in any manner
  5.  
  6. Me![cboTest].RowSourceType = "Value List"
  7.  
  8. For intCounter = lngMin To lngMax
  9.   Me![cboTest].AddItem intCounter
  10. Next
Mar 11 '07 #5

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

Similar topics

29
7487
by: Chris Dutrow | last post by:
I searched around on the net for a bit, couldn't find anything though. I would like to find some code for a function where I input A Range Of Integers For example: Function( 1, 100 ); And the function will return me an array holding a random subset of integers in that range of a size that I specify So the Function would Probabaly look something like this:
19
2434
by: Harshan | last post by:
The range of signed int is - 2^15 to + (2^15 )-1 (-32768 to 32767) Why the one less at positive Range ? (compared to the negative side..!) I came to know that it uses 2's compliment internally for storing the negative numbers . why it uses 2's compliment but not the ones compliment for storing the negative numbers ?
8
1890
by: tkpmep | last post by:
I need to create ranges that can start and end with real numbers. Searching this newsgroup brought me to a function that I then modified as follows: def myRange(iMin, iMax=None, iStep=1): """Extends range to real numbers. Wherever possible, use Python's range . In other cases, make the behavior follow the spirit of Python's range """ epsilon = 1.e-8
10
3020
by: Rafael Cunha de Almeida | last post by:
Hi, I've found several sites on google telling me that I shouldn't use rand() % range+1 and I should, instead, use something like: lowest+int(range*rand()/(RAND_MAX + 1.0))
2
5479
by: alishaikhji | last post by:
I am working on a program which will need several different integer and float random numbers at different stages, for example: - At one point, I need a random number (float) in the range 0.1 to 10.0 - At one point, I need a random number (float) in the range 0.5 to 1.5 - At one point, I need a random number (float) in the range 0.3 to 3.0 - At one point, I need a random number (float) in the range 0.1 to 10.0 Also, I need to make it sure...
0
9645
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10148
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.