Ok, another question for you.
I now have all the tables set up with fields for Question1, Question2, etc.
and am using the option group for the users to answer the question with a Y,
N/I, N or N/A.
The answers are assigned values as follows:
Y=1, N/I=2, N=3 and N/A=4
I would like to know the number of times N/I or N is chosen as an anwer for
every question in the table. I have found a way to do this through a query
but it is very lengthy (see a partial example below - some of the tables have
23 questions).
SELECT Count(qryForkliftLetdownPM.Question1) AS CountOfQuestion1,
Count(qryForkliftLetdownPM.Question2) AS CountOfQuestion2,
Count(qryForkliftLetdownPM.Question3) AS CountOfQuestion3,
Count(qryForkliftLetdownPM.Question4) AS CountOfQuestion4
FROM qryForkliftLetdownPM
WHERE (((qryForkliftLetdownPM.Question1)="2")) OR
(((qryForkliftLetdownPM.Question2)="2")) OR
(((qryForkliftLetdownPM.Question3)="2")) OR
(((qryForkliftLetdownPM.Question4)="2"))
I am doing these queries for "2" (N/I) and "3" (N) separately. Is there an
easier way?
AccessIM said:
That is wonderful!!! Thank you so much for the suggestion. It works so much
better and is more efficient than the way I was doing it!
KARL DEWEY said:
I like to use macros rather than code.
Open the form in design view and click on the option group frame. Right
click and select properties. Scroll down to On Update. Type in the name of
the macro you will use.
Create the macro using condition to see if the option group (
[Forms]![YourFormName]![Frame1] ) > 0
Have action GotoControl -- your comment field.
In the comment field property On Lost Focus call macro.
Create the macro using condition to see if the comments are null (
[Forms]![YourFormName]![YourTextBox] ) Is Null
Have action MsgBox -- say need comments in the field.
Have action GotoControl -- your comment field.
--
KARL DEWEY
Build a little - Test a little
:
I have never used an option group before and that works great. Thank you for
that!
Can you tell me how I would make it a requirement to enter a comment if N/I
or N is choosen from the option group?
:
You should not be using three fields but an Option Group that uses one field.
--
KARL DEWEY
Build a little - Test a little
:
I don't know if this is possible but here it goes...
I have a form based on a table that contains yes/no fields labeled "Y",
"N/I" and "N". A comment is required when the supervisor selects that the
employee needs improvement (N/I) or is not doing something correctly (N).
The supervisors know this but I would like to build it into the form if
possible.
I would like to set the form up so that if the user checks the "N/I" or "N"
boxes the focus moves to the Comments field and stays there until they enter
a comment about what the employee needs to improve.
Is this possible? Thank you in advance.