Form opens with Option Group choice pre-selected

RJW

Registered User.
Local time
Yesterday, 20:05
Joined
Sep 21, 2006
Messages
44
I have a form, called "Repairs" with an Option Group. Clicking a button in the Option Group will reveal a specific set of fields on the form. (That works fine)

Now I would like to add a button on a different form that opens the "Repairs" form with one of the Option Group choices already selected. I can accomplish this with ...

Forms!Repairs!Frame0.DefaultValue = 1

But the fields that should be revealed when clicking the button are not visible when the form opens.

How do I execute the "After Update" code for that button when the form opens?

Thanks for your help

RJ
 
You'd have to make it public and then call it with something like:

Forms!Repairs.Frame0_AfterUpdate()

which is untested.
 
Forms!Repairs.Frame0_AfterUpdate()

This line as is ... gives a syntax error (turns red)


RJ
 
Try

Call Forms!Repairs.Frame0_AfterUpdate()

I can open a db and test if that doesn't work.
 
Same result.

And to be clear ... the code, so far, in the command button is ...


DoCmd.OpenForm "Repairs", acNormal, "", "", , acNormal
Forms!Repairs!Frame0.DefaultValue = 1


RJ
 
Just tested and this worked in a test db:

Forms!Form1.Command3_Click

so try

Forms!Repairs.Frame0_AfterUpdate

Make sure you've changed Private to Public for the after update code.
 
That worked.

Must have been the "()"

Thanks pbaldy


RJ
 

Users who are viewing this thread

Back
Top Bottom