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

104429ABC40
104594EFG1

<caption> tblProduct </caption><thead>
[TH="bgcolor: #c0c0c0"] Code [/TH]
[TH="bgcolor: #c0c0c0"] Description [/TH]
[TH="bgcolor: #c0c0c0"] CaseWeight [/TH]

</thead><tbody>
</tbody><tfoot></tfoot>
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
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,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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