Access query with Criteria

maabbas

Board Regular
Joined
Aug 11, 2011
Messages
201
Hello Everyone,

I have a tblProduct which has following columns
ProductCode
ProductDesc
CaseWeight

there are some caseweight does not have specific weights and I am using "1" in table , please see below. is there any way in the query I can add criteria when the caseweight =1 then ask user to input, otherwise use the caseweight in the table.

Thanks in advance

CodeDescriptionCaseWeight
104429ABC40
104594EFG1

<caption> tblProduct </caption><thead>
</thead><tbody>
</tbody><tfoot></tfoot>
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
firstly - I wouldn't use 1's. I would prefer 0, Null (empty cell), or -1 (or any negative number).
I don't know how you can use a query to ask the user for such input.
What you could do is use an UserForm and ask the user to provide input for any of the records in the recordsset.
You can use something like this for the form's RecordSource:
Code:
SELECT * FROM tblProduct WHERE CaseWeight = 1
(hopefully the caseweight field is of Number type)
 
Upvote 0
firstly - I wouldn't use 1's. I would prefer 0, Null (empty cell), or -1 (or any negative number).
I don't know how you can use a query to ask the user for such input.
What you could do is use an UserForm and ask the user to provide input for any of the records in the recordsset.
You can use something like this for the form's RecordSource:
Code:
SELECT * FROM tblProduct WHERE CaseWeight = 1
(hopefully the caseweight field is of Number type)


Thanks bobsan, I forget to mention I made a form from that query, where user will enter data.
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top