[AccessD] Forcing an event

Susan Harkins ssharkins at gmail.com
Wed Nov 12 14:12:48 CST 2014


I have a command button on one form that opens a second form. On the second
form, I use a click event to enable and disable other controls based on the
value in the clicked event.

I'm also passing a value to the second form and using that to filter the
form's Recordset -- so the control that determines the disabling and
enabling has a selected value. I need to force that click to enable and
disable the other controls.

All this happens for me automatically when opening the form for new
records, because the user must select a value to trigger the event that
disables/enables the other controls. When opening from the other form,
however, the value is already set to the appropriate animal's record.

I tried the Call statement to force the click event, but it doesn't work. I
think the problem is that the code calling is on the first form. When I
explicitly name the form in the Call statement, I get an error --

Call Forms![Enter Disposition Details]!lstDispositionDetailsID_Click()

VBA just won't take that syntax. I looked it up and Call wants only the
procedure name.

I suppose I could write some kind of evaluation in the form's open event
that tries to determine how the form is being opened, but that sounds
gruesome. I can train the user to just click the control of course, but
that's error prone because users forget.

Any suggestions?

Susan H.


More information about the AccessD mailing list