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

Untick yes/no field

P: n/a
Hi.
I'd like to know if after the records have been ticked , whether one can
then have those same records unticked - in case a mistake had been made the
first time to tick them.
----------------------
Assuming your table has a numeric primary key named "ID", you can get 170
random records in the date range with this kind of thing: SELECT TOP 170 * FROM [tbl_data entry]
WHERE [Enquiry Date] Between #1/31/2004# And #2/29/2004#
ORDER BY Rnd([ID]), ID;
You can then turn it into an Update query (Update on query menu) to update
the Free field to True. Notes:
1. Issue a Randomize in the Immediate Window Ctrl+G) before running the query.
2. The Rnd() function does not do anything with the ID field, but if you do
not pass in a changing number, the optimizer does not call the Rnd()
function on every row.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Manton" <sk**@optusnet.com.au> wrote in message
news:40**********************@news.optusnet.com.au ... Access 2000.
I have a field in a table (tbl_data entry) which has a field called Free and another field called SD (containing 2 options: 5 and 6)
The Free field is a yes/no format.
I'd like to run a query which upon entering a date range ("Enquiry Date")
value -allows the query to choose 170 records (by ticking off the yes/no
field "Free") randomly from tbl_data entry.
Alternatively: It could choose (ticking off the yes/no field "Free) the
first 170 records within the date range entered (choosing the earliest date and working down the list).
thanks.



Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
A yes/no field is just that -- a field with a value of Yes or No (True or
False in VBA code). There's nothing to prevent it being changed, no matter
what setting it currently has, unless you set form properties to disable
and/or lock the control where it is displayed. And, even if that is the
case, it can still be modified with an update query, or from datasheet view.

Did someone post something that you thought indicated a Yes/No field was a
"one-shot set and never change again" situation?

Larry Linson
Microsoft Access MVP

"Manton" <sk**@optusnet.com.au> wrote in message
news:40***********************@news.optusnet.com.a u...
Hi.
I'd like to know if after the records have been ticked , whether one can
then have those same records unticked - in case a mistake had been made the first time to tick them.
----------------------
Assuming your table has a numeric primary key named "ID", you can get 170
random records in the date range with this kind of thing:

SELECT TOP 170 * FROM [tbl_data entry]
WHERE [Enquiry Date] Between #1/31/2004# And #2/29/2004#
ORDER BY Rnd([ID]), ID;
You can then turn it into an Update query (Update on query menu) to updatethe Free field to True.

Notes:
1. Issue a Randomize in the Immediate Window Ctrl+G) before running the

query.
2. The Rnd() function does not do anything with the ID field, but if you donot pass in a changing number, the optimizer does not call the Rnd()
function on every row.


--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Manton" <sk**@optusnet.com.au> wrote in message
news:40**********************@news.optusnet.com.au ...
Access 2000.
I have a field in a table (tbl_data entry) which has a field called Free

and
another field called SD (containing 2 options: 5 and 6)
The Free field is a yes/no format.
I'd like to run a query which upon entering a date range ("Enquiry Date") value -allows the query to choose 170 records (by ticking off the yes/no
field "Free") randomly from tbl_data entry.
Alternatively: It could choose (ticking off the yes/no field "Free) the
first 170 records within the date range entered (choosing the earliest

date
and working down the list).
thanks.


Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.