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

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

176 100+
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 4711
Rabbit
12,516 Expert Mod 8TB
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 100+
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 Expert Mod 8TB
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 Expert 8TB
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
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...
19
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...
8
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):...
10
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
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...
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
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
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,...

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.