Form showing results in between two numbers (1 Viewer)

hllary

Registered User.
Local time
Yesterday, 18:39
Joined
Sep 23, 2019
Messages
80
I'm building a database that contains error codes and the starting part number and the ending part numbers effected. The part numbers are continues, they go from 0 to 120. The number of parts is too large to include all of them in one table. So, I have a made a form that has a text box where the user enters a part number and a subform table will show any records that have that part number between the starting and ending part number. I tried to do it in VBA but I couldn't get the code to work. So I'm trying to do it with a query.

I have a query which will use the text box in the form as a criteria but I can't figure out how to make the criteria less than and greater than.

I've tried the statement below but do not get any results.

WHERE ((([Forms]![Table1_frm]![Search])>=[StartingPartNum]));

Thank you in advance.
 

Attachments

  • ErrorCodes_Parts.accdb
    1.8 MB · Views: 75

isladogs

MVP / VIP
Local time
Today, 02:39
Joined
Jan 14, 2017
Messages
18,216
The number of parts is too large to include all of them in one table.

Why do you say that?
Access tables can contain millions of records without problems.
The only limit is that the overall database size cannot exceed 2GB

As for your WHERE statement it needs to be based on the table / query name used in your form
You can either use
Code:
Between [StartingPartNum] And [EndingPartNum]
or
Code:
>=[StartingPartNum] And <= [EndingPartNum]
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:39
Joined
May 7, 2009
Messages
19,231
see your query and the macro behind query button.
 

Attachments

  • ErrorCodes_Parts.zip
    36.5 KB · Views: 79

Users who are viewing this thread

Top Bottom