By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

Split List

P: n/a
TblOptions
OptionID
Option

There are 7 option records. If I have two subforms, how do I list the first
4 options in the first subform and the last 3 options in the second subform?

Thank You!!

Marie
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Given that we're talking about a relational database, what do you mean by
"first"? With the answer to that, we can probably help answer your question.

On Wed, 08 Sep 2004 05:56:35 GMT, "Marie" <mh*****@earthlink.net> wrote:
TblOptions
OptionID
Option

There are 7 option records. If I have two subforms, how do I list the first
4 options in the first subform and the last 3 options in the second subform?

Thank You!!

Marie


Nov 13 '05 #2

P: n/a
Maria, You could design 2 queries. Set the criteria of each to pull the records you want. After
you have them setup set the recordsource of your subforms to these queries.

Hope this helps!

--
Reggie

----------
"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:o0********************************@4ax.com...
Given that we're talking about a relational database, what do you mean by
"first"? With the answer to that, we can probably help answer your question.

On Wed, 08 Sep 2004 05:56:35 GMT, "Marie" <mh*****@earthlink.net> wrote:
TblOptions
OptionID
Option

There are 7 option records. If I have two subforms, how do I list the first
4 options in the first subform and the last 3 options in the second subform?

Thank You!!

Marie

Nov 13 '05 #3

P: n/a
I can do the first query sorting alphabetically and getting the Top 4. How
do I design the second query to get the last three in the sort order?

Marie
"Reggie" <NoSpam_chief123101@NoSpam_yahoo.com> wrote in message
news:b4********************@comcast.com...
Maria, You could design 2 queries. Set the criteria of each to pull the records you want. After you have them setup set the recordsource of your subforms to these queries.
Hope this helps!

--
Reggie

----------
"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:o0********************************@4ax.com...
Given that we're talking about a relational database, what do you mean by "first"? With the answer to that, we can probably help answer your question.
On Wed, 08 Sep 2004 05:56:35 GMT, "Marie" <mh*****@earthlink.net> wrote:
TblOptions
OptionID
Option

There are 7 option records. If I have two subforms, how do I list the first4 options in the first subform and the last 3 options in the second subform?
Thank You!!

Marie


Nov 13 '05 #4

P: n/a
Where Table2 has a field called [n]

1st query (called query3)
SELECT TOP 4 Table2.n
FROM Table2
ORDER BY Table2.n;

2nd query
SELECT TOP 3 t2.n
FROM Table2 AS t2 LEFT JOIN Query3 AS q3 ON t2.n = q3.n
WHERE (((q3.n) Is Null))
ORDER BY t2.n;

Having said that don't forget that if there is a match for the nth place in
a SELECT TOP n you will get more than n rows, and if this match occurs in
query3 (above) and there are exactly 7 rows in your table you will get less
than 3 rows in the second query.

e.g.
If Table2 contains the following data

n
-----
z
r
c
a
v
b
t

1st query results
n
----
a
b
c
r

2nd query results
n
----
t
v
z
But if Table2 contains the following data
(note the double entry of 'r')

n
----
z
r
c
a
v
b
r

1st query results
n
----
a
b
c
r
r

2nd query results
n
----
v
z
--
Terry Kreft
MVP Microsoft Access
"Marie" <mh*****@earthlink.net> wrote in message
news:2Y******************@newsread3.news.atl.earth link.net...
I can do the first query sorting alphabetically and getting the Top 4. How
do I design the second query to get the last three in the sort order?

Marie
"Reggie" <NoSpam_chief123101@NoSpam_yahoo.com> wrote in message
news:b4********************@comcast.com...
Maria, You could design 2 queries. Set the criteria of each to pull the
records you want. After
you have them setup set the recordsource of your subforms to these

queries.

Hope this helps!

--
Reggie

----------
"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:o0********************************@4ax.com...
Given that we're talking about a relational database, what do you mean

by "first"? With the answer to that, we can probably help answer your question.
On Wed, 08 Sep 2004 05:56:35 GMT, "Marie" <mh*****@earthlink.net> wrote:
>TblOptions
>OptionID
>Option
>
>There are 7 option records. If I have two subforms, how do I list the first>4 options in the first subform and the last 3 options in the second subform?>
>Thank You!!
>
>Marie
>



Nov 13 '05 #5

P: n/a
Maria, One other thing if the option values are always the same and the same values always
represent the Top values you could do something like as the criteria for your Option field:

In ("a","b","c","d") for one of the queries and (top 4)
In ("e","f","g") for the other query.
--
Reggie

----------
"Marie" <mh*****@earthlink.net> wrote in message
news:2Y******************@newsread3.news.atl.earth link.net...
I can do the first query sorting alphabetically and getting the Top 4. How
do I design the second query to get the last three in the sort order?

Marie
"Reggie" <NoSpam_chief123101@NoSpam_yahoo.com> wrote in message
news:b4********************@comcast.com...
Maria, You could design 2 queries. Set the criteria of each to pull the

records you want. After
you have them setup set the recordsource of your subforms to these

queries.

Hope this helps!

--
Reggie

----------
"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:o0********************************@4ax.com...
> Given that we're talking about a relational database, what do you mean by > "first"? With the answer to that, we can probably help answer your question. >
> On Wed, 08 Sep 2004 05:56:35 GMT, "Marie" <mh*****@earthlink.net> wrote:
>
>>TblOptions
>>OptionID
>>Option
>>
>>There are 7 option records. If I have two subforms, how do I list the first >>4 options in the first subform and the last 3 options in the second subform? >>
>>Thank You!!
>>
>>Marie
>>
>



Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.