unchecking check boxes

C

Christina

I'm trying to put together a database for a nonprofit organization that will match the requirements of what they require for an upload of our data. The two things I am having trouble figuring out are
How to set the check boxes so that if they aren't required and a data entry person accidentally checks them, they can be unchecked and the field left black
Also, how to select multiple items in a field and have them be listed in the field with only a comma separating them. That is how the government's database is set up
Any help would greatly be appreciated.
 
T

Tim Ferguson

How to set the check boxes so that if they aren't required and a data
entry person accidentally checks them, they can be unchecked and the
field left black.

For this, you'll need the new Windows Telepathy Extension, which contains
an AccidentDetection Active X control -- I haven't used it but I believe it
has an API that allows you to tell whether the user checked a box
deliberately or by accident.
Also, how to select multiple items in a field and
have them be listed in the field with only a comma separating them.
That is how the government's database is set up.

There is a function and a query for this on Dev Ashish's site
<http://www.mvps.org/access/>

Hope that helps


Tim F
 
D

Duane Hookom

Tim,
You are going to have people searching google for "Telepathy Extension" ;-)
 
G

Gary Miller

Did you get it from Dev's site as well ;-)

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
T

TC

Well, when I google web search on Windows Telepathy Extension (unquoted), I
get 1,570 hits !!!

A very nice joke indeed. Well done Tim F! :)

TC
 
G

Gary Miller

Christina,

You did get quite a few chuckles on the list for your first
question as, in it's nature, is kind of undefinable and
impossible to ever know what a user was intending when they
made some keystrokes to make a given entry. I hope that you
have taken no offense over this. We, on the list, are pretty
used to getting asked the impossible, and this one did fall
into that category. Tim's off the cuff reply was a bit
facetious, but very humourous in it's own way.

For the second part of your question, look into 'ListBoxes'
in help. They can return a value ( not always easy to get )
that will return values separated by commas when they are in
the MultiSelect mode. Play with this and get back when you
have specific questions on how to implement them into your
db.

Regards,

Gary

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
message
I'm trying to put together a database for a nonprofit
organization that will match the requirements of what they
require for an upload of our data. The two things I am
having trouble figuring out are:
How to set the check boxes so that if they aren't required
and a data entry person accidentally checks them, they can
be unchecked and the field left black.
Also, how to select multiple items in a field and have
them be listed in the field with only a comma separating
them. That is how the government's database is set up.
 
I

Immanuel Sibero

Christina,

As was said, I hope you don't take offense. Sometimes we do this to loosen
up a little.

Maybe your first question is not so unreasonable, just not put in the most
effective way. If you're concerned about a user "accidentally" check or
uncheck a box, you can get confirmation of this action from the user by
putting a code in the "Before Update" event for that checkbox. For example,
a message box can appear asking them if they are absolutely sure. Further,
it's also possible to design it where the message box would appear only when
certain conditions are met. (So that the message box doesnt appear everytime
and irritate the users, since it would only make them more *accident
prone*). Just an idea...


HTH
Immanuel Sibero
 
T

Tim Ferguson

For the second part of your question, look into 'ListBoxes'
in help. They can return a value ( not always easy to get )
that will return values separated by commas when they are in
the MultiSelect mode. Play with this and get back when you
have specific questions on how to implement them into your
db.
There is _no_ way of getting a listbox to return multiple values with
commas -- at least, none of the versions that I have used. Can you provide
pointers to any of the documentation that describes this -- preferably in
the Help files?

The long answer to the OPs second question actually demands (a) a proper
table design, with a suitable one-to-many relationship, and (b) some VBA
programming to use the Selected() method of the ListBox and insert records
into the "many" table. Finally, he or she will need some more code to
reassemble the records from the "many" table back into a single
denormalised pseudocolumn in a query on on a report. It is all quite easy
to do, but needs a worked example, which is why I pointed him or her to the
AccessWeb site.

Jokes aside, I don't usually offer a glib answer unless there is something
useful to say as well...


Best wishes


Tim F
 
G

Gary Miller

Tim,

Here is a function that will do it. I think that Jim Pawson
gets the credit for this one....
********************

Function jpListBoxToString(ByVal plst As ListBox, Optional
ByVal pstrSeparator
As String = ", ") As String
' Accepts:
' Listbox - presumably multiselect
' Optional string to be used to separate list
entries in the returned
string
' (defaults to , if not passed)
' Returns:
' String containing the bound column entry for each
of the selected
entries
' in Listbox, separated by the passed separator.
' Returns a zero length string if no entries are
selected

' eg
' If lstMyBox has entries Jack, Jill and Janet selected,
then
' jpListToString(lstMyBox, "*+")
' will return
' Jack*+Jill*+Janet

Dim strWork As String
Dim varIndex As Variant

strWork = ""

For Each varIndex In plst.ItemsSelected
strWork = strWork & plst.ItemData(varIndex) &
pstrSeparator
Next

If Len(strWork) > 0 Then
strWork = Left$(strWork, Len(strWork) -
Len(pstrSeparator))
End If

jpListBoxToString = strWork

End Function


--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
J

Joan Wild

Gary Miller said:
You did get quite a few chuckles on the list for your first
question as, in it's nature, is kind of undefinable and
impossible to ever know what a user was intending when they
made some keystrokes to make a given entry.

On the other hand if "they aren't required", then either disable them, lock
them, or don't put them on the form at all.
 
C

Christina

I don't think you guys understand what I am asking. We have a form that combines different government required questions. Certain questions must be formatted in a certain way with certain coding so that when I query I can export it to a text file and upload. Now, there are some questions that aren't absolutely necessary, but that we do need to gather data on. Our clients at times choose not to answer some of the questions. When our administrative assistant or me will enter these forms into the database form, sometimes we may check yes to question 10, but then realize we accidentally checked yes to 10 and we meant to check yes to question 11. Well, I can't uncheck question 10 and I need to delete the record and start all over because question 10 wasn't answered and we can't make up information to report to the government. Is this more clear? I know there's got to be a way to do this, because every other database I've entered data into I've been able to uncheck a question.
 
J

Joan Wild

Please explain why, when you realize you accidentally checked yes to 10,
that you can't at that point uncheck it?

--
Joan Wild
Microsoft Access MVP

Christina said:
I don't think you guys understand what I am asking. We have a form that
combines different government required questions. Certain questions must be
formatted in a certain way with certain coding so that when I query I can
export it to a text file and upload. Now, there are some questions that
aren't absolutely necessary, but that we do need to gather data on. Our
clients at times choose not to answer some of the questions. When our
administrative assistant or me will enter these forms into the database
form, sometimes we may check yes to question 10, but then realize we
accidentally checked yes to 10 and we meant to check yes to question 11.
Well, I can't uncheck question 10 and I need to delete the record and start
all over because question 10 wasn't answered and we can't make up
information to report to the government. Is this more clear? I know
there's got to be a way to do this, because every other database I've
entered data into I've been able to uncheck a question.
 
C

cafe

Ok - now it's clear.

Set the TripleState property of the checkboxes, to True. Then when you click
them, they will cycle between ticked (true), unticked (false), and
greyed-out (null). So you can easily "erase" the tick, if you ticked the
checkbox accidentally. When TripleState is false, the checkbox will only go
from ticked to blank & vice versa.
However<, what field type are these checkboxes bound to in the underlying
table? If it is a Yes/No type, you're out of luck, because Yes/No fields (in
tables) can not contain null vaklues - they are always true, or false -
never null.

HTH,
TC


Christina said:
I don't think you guys understand what I am asking. We have a form that
combines different government required questions. Certain questions must be
formatted in a certain way with certain coding so that when I query I can
export it to a text file and upload. Now, there are some questions that
aren't absolutely necessary, but that we do need to gather data on. Our
clients at times choose not to answer some of the questions. When our
administrative assistant or me will enter these forms into the database
form, sometimes we may check yes to question 10, but then realize we
accidentally checked yes to 10 and we meant to check yes to question 11.
Well, I can't uncheck question 10 and I need to delete the record and start
all over because question 10 wasn't answered and we can't make up
information to report to the government. Is this more clear? I know
there's got to be a way to do this, because every other database I've
entered data into I've been able to uncheck a question.
 
C

cafe

(snip)
If you're concerned about a user "accidentally" check or
uncheck a box, you can get confirmation of this action from the user by
putting a code in the "Before Update" event for that checkbox. For example,
a message box can appear asking them if they are absolutely sure. Further,
it's also possible to design it where the message box would appear only when
certain conditions are met. (So that the message box doesnt appear everytime
and irritate the users, since it would only make them more *accident
prone*). Just an idea...

I have the reverse situation. One of my applications needs to store a list
of rude & offensive words "behind the scenes". There is a semi-hidden option
to display & edit that list. Before I display it, I pop up a warning asking
the user to confirm that he is willing to view such words. But I am sure the
users will click straght through that message, like they do with >most<
messages! So I am considering popping up a textbox & asking them to type the
word YES !

TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top