View Full Version : Is Macro the best solution?


taxdw
01-18-2007, 06:52 AM
I am creating a form that asks questions. If the person checks the box it will then send a field some text to be viewed later. I have about 32 questions. Is creating 32 macro's the best approach to the solution or is there an easier way to do this?

ex: Client can not groom/dress without assistance
If the box is check then the serviceNeeds field = "Home Health Services"

FoFa
01-18-2007, 11:42 AM
That's one way. I think I would use the click event of each control, check to see if it was checked or unchecked and handle it there in the procedure. Kind of keeps it together better.

taxdw
01-18-2007, 11:57 AM
I tried to create an onclick statement as follows:

=IIf(FormADL!nutrFeed=No,FormADL!nutrFeedNeeds="Nutritional Services","")

and it is giving me an error: The expression onClick you entered as the event property produced the following error: The object doesn't contain the automation object FormADL.

Do you know why this is happenind?

FoFa
01-22-2007, 11:31 AM
I would create an Event Procedure iin the ON CLICK event, and use this:
IF Me.nutrFeed TRUE then
Me.nutrFeedNeeds = "Nu tritional Services"
ELSE
Me.nutrFeedNeeds=""
END IF

boblarson
01-22-2007, 11:54 AM
=IIf(FormADL!nutrFeed=No,FormADL!nutrFeedNeeds="Nu tritional Services","")


The code you posted above, has some syntactic issues. So the correct syntax for a controlsource of a text box would be:

=IIf([Forms]![FormADL]![nutrFeed] = False,[Forms]![FormADL]![nutrFeedNeeds]="Nutritional Services","")

[/code]