how to count the squenc between two numbers

G

ghost

Greeting,

I have a table has two fields, the first one is Start and the second is End,
and both of them are numbers. What I want to do is making a form and unbound
text box that count the sequence numbers that located between the two numbers
For Example:

Start : 1
End : 11

The result is:
2
3
4
5
6
7
8
9
10

Note: the start and end date may be random numbers
Any help please?
 
A

Allen Browne

You will need a counting table to achieve this.

Take a look at:
Print a Quantity of a Label
at:
http://allenbrowne.com/ser-39.html

This example shows how to set up such a table, and then generate the records
you need. The only difference is that you have a Start field as well as an
End field, whereas the example has only the end field (named Quantity.) So
you will use:
Between [Start] And [End]
instead of:
<= [Quantity]

BTW, hopefully your fields are not really called Start and End. END is a
reserved word, and START is future-reserved (so could cause you problems in
the future.) For a list of the field names to avoid, see:
http://allenbrowne.com/AppIssueBadWord.html
 
G

ghost

Thank you
I did all those steps but where should the results appear please? And where
should I put the condition Between Start1 and end1?


Allen Browne said:
You will need a counting table to achieve this.

Take a look at:
Print a Quantity of a Label
at:
http://allenbrowne.com/ser-39.html

This example shows how to set up such a table, and then generate the records
you need. The only difference is that you have a Start field as well as an
End field, whereas the example has only the end field (named Quantity.) So
you will use:
Between [Start] And [End]
instead of:
<= [Quantity]

BTW, hopefully your fields are not really called Start and End. END is a
reserved word, and START is future-reserved (so could cause you problems in
the future.) For a list of the field names to avoid, see:
http://allenbrowne.com/AppIssueBadWord.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

ghost said:
Greeting,

I have a table has two fields, the first one is Start and the second is
End,
and both of them are numbers. What I want to do is making a form and
unbound
text box that count the sequence numbers that located between the two
numbers
For Example:

Start : 1
End : 11

The result is:
2
3
4
5
6
7
8
9
10

Note: the start and end date may be random numbers
Any help please?
 
A

Allen Browne

You performed steps 1 - 3 in the article.
Step 4 says to enter this in the Criteria row under tblCount.CountID:
<= [Quantity]

Instead enter:
Between [Start] And [End]

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

ghost said:
Thank you
I did all those steps but where should the results appear please? And
where
should I put the condition Between Start1 and end1?


Allen Browne said:
You will need a counting table to achieve this.

Take a look at:
Print a Quantity of a Label
at:
http://allenbrowne.com/ser-39.html

This example shows how to set up such a table, and then generate the
records
you need. The only difference is that you have a Start field as well as
an
End field, whereas the example has only the end field (named Quantity.)
So
you will use:
Between [Start] And [End]
instead of:
<= [Quantity]

BTW, hopefully your fields are not really called Start and End. END is a
reserved word, and START is future-reserved (so could cause you problems
in
the future.) For a list of the field names to avoid, see:
http://allenbrowne.com/AppIssueBadWord.html

ghost said:
Greeting,

I have a table has two fields, the first one is Start and the second is
End,
and both of them are numbers. What I want to do is making a form and
unbound
text box that count the sequence numbers that located between the two
numbers
For Example:

Start : 1
End : 11

The result is:
2
3
4
5
6
7
8
9
10

Note: the start and end date may be random numbers
 
G

ghost

Thank you,

Already done and it works, but now I am wondering how to present the result
in label or text box, I need the result to be shown as follows:
2,3,4,5,…..etc

How to do that?


Allen Browne said:
You performed steps 1 - 3 in the article.
Step 4 says to enter this in the Criteria row under tblCount.CountID:
<= [Quantity]

Instead enter:
Between [Start] And [End]

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

ghost said:
Thank you
I did all those steps but where should the results appear please? And
where
should I put the condition Between Start1 and end1?


Allen Browne said:
You will need a counting table to achieve this.

Take a look at:
Print a Quantity of a Label
at:
http://allenbrowne.com/ser-39.html

This example shows how to set up such a table, and then generate the
records
you need. The only difference is that you have a Start field as well as
an
End field, whereas the example has only the end field (named Quantity.)
So
you will use:
Between [Start] And [End]
instead of:
<= [Quantity]

BTW, hopefully your fields are not really called Start and End. END is a
reserved word, and START is future-reserved (so could cause you problems
in
the future.) For a list of the field names to avoid, see:
http://allenbrowne.com/AppIssueBadWord.html

Greeting,

I have a table has two fields, the first one is Start and the second is
End,
and both of them are numbers. What I want to do is making a form and
unbound
text box that count the sequence numbers that located between the two
numbers
For Example:

Start : 1
End : 11

The result is:
2
3
4
5
6
7
8
9
10

Note: the start and end date may be random numbers
 
A

Allen Browne

You will need to write some VBA code to concatenate the values together.

Here's an example of code that does that:
http://www.mvps.org/access/modules/mdl0004.htm

If you don't know anything about VBA code, you may find this is beyond you.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

ghost said:
Thank you,

Already done and it works, but now I am wondering how to present the
result
in label or text box, I need the result to be shown as follows:
2,3,4,5,…..etc

How to do that?


Allen Browne said:
You performed steps 1 - 3 in the article.
Step 4 says to enter this in the Criteria row under tblCount.CountID:
<= [Quantity]

Instead enter:
Between [Start] And [End]

ghost said:
Thank you
I did all those steps but where should the results appear please? And
where
should I put the condition Between Start1 and end1?


:

You will need a counting table to achieve this.

Take a look at:
Print a Quantity of a Label
at:
http://allenbrowne.com/ser-39.html

This example shows how to set up such a table, and then generate the
records
you need. The only difference is that you have a Start field as well
as
an
End field, whereas the example has only the end field (named
Quantity.)
So
you will use:
Between [Start] And [End]
instead of:
<= [Quantity]

BTW, hopefully your fields are not really called Start and End. END is
a
reserved word, and START is future-reserved (so could cause you
problems
in
the future.) For a list of the field names to avoid, see:
http://allenbrowne.com/AppIssueBadWord.html

Greeting,

I have a table has two fields, the first one is Start and the second
is
End,
and both of them are numbers. What I want to do is making a form and
unbound
text box that count the sequence numbers that located between the
two
numbers
For Example:

Start : 1
End : 11

The result is:
2
3
4
5
6
7
8
9
10
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top