Solved show specified data and all records before (1 Viewer)

basilyos

Registered User.
Local time
Today, 07:26
Joined
Jan 13, 2014
Messages
252
hello guys congratulations for the new look :love:

i have a table with 15 record each record have a unique name
1-A
2-B
3-C
.
.
.
15-X

in a form if i choose from a combo box for example letter D and run the query (or vba code) i want to get all records from D and before

so i will get
1-A
2-B
3-C
4-D

any help?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 09:26
Joined
Feb 28, 2001
Messages
27,142
Depending on how you set up the combo box, it might be possible to reference it in the query. It might also be possible to just extract the name field and supply it as a parameter to a parameter query. Once you have the name, assuming the table to be in alphabetic order, you can build a query with a WHERE clause that says "WHERE recordname < selectedname" (of course you fill in your own names for this.)

https://support.office.com/en-us/ar...-reports-8209eb5c-1589-42e2-9b20-4181f4c7a356 (verbiage)

(video)

https://www.access-programmers.co.uk/forums/threads/passing-parameter-from-form-to-query.132949/ (from this forum)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:26
Joined
Oct 29, 2018
Messages
21,456
Hi basilyos. Just to clarify, are we talking about "before" based on alphabetically or numerically?
 

basilyos

Registered User.
Local time
Today, 07:26
Joined
Jan 13, 2014
Messages
252
hey guys sorry for bothering and thanks for helping me

i solved my problem by just using criteria in my query where i add my 15 records table in a specific range
at ID field
criteria = <= [forms]![form1]![id]

so i should delete the post??

thanks again
 

Gasman

Enthusiastic Amateur
Local time
Today, 15:26
Joined
Sep 21, 2011
Messages
14,235
hey guys sorry for bothering and thanks for helping me

i solved my problem by just using criteria in my query where i add my 15 records table in a specific range
at ID field
criteria = <= [forms]![form1]![id]

so i should delete the post??

thanks again
No, Please just mark it as solved. It could likely help someone else later with a similar problem.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 09:26
Joined
Feb 28, 2001
Messages
27,142
basilyos, we almost never delete a technical post. We have the usual share of misbehaving members and some of their posts get censored. But we just about NEVER delete a tech post because, as Gasman points out, someone could search for that topic and find previous answers. Which is a good thing for us. Thank you for your contribution.
 

Users who are viewing this thread

Top Bottom