[AccessD] Forcing an event

David Emerson newsgrps at dalyn.co.nz
Wed Nov 12 14:30:15 CST 2014


Hi Susan,

Try:

    Call Forms("Enter Disposition Details "). lstDispositionDetailsID_Click

Regards

David Emerson
Dalyn Software Ltd
Wellington, New Zealand



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
Sent: Thursday, 13 November 2014 9:13 a.m.
To: Access Developers discussion and problem solving
Subject: [AccessD] Forcing an event

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.
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list