On Load Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does the OnLoad event occur if a form is opened in a hidden mode? Also, this
same form contains a commond button. Is there a way to trigger that On Click
event via VBA on a different form?

I have a continuous form where users can select multiple items to export. I
need the single page form to open against each (hidden), have the On Load
event occur, then perform the function called out on the command button.

When I attempted to add the VBA from the command button on the continous
form (after opening up the form in hidden mode), I get an error that the
database object is read-only. This does not occur if I open the single page
form directly and execute the command button.

Thanks for help.
Bernie
 
Answers inline....

--

Ken Snell
<MS ACCESS MVP>

Bernie said:
Does the OnLoad event occur if a form is opened in a hidden mode?
Yes.


Also, this
same form contains a commond button. Is there a way to trigger that On
Click
event via VBA on a different form?

Change the "CommandButtonName_Click" procedure to be a public subroutine.
Then call it (when the form is open) by
Call Form_NameOfYourForm.CommandButtonName_Click


I have a continuous form where users can select multiple items to export.
I
need the single page form to open against each (hidden), have the On Load
event occur, then perform the function called out on the command button.

I think you're trying to use a form as a substitute for a recordset. Believe
me (as one who designed his first database application for "fun" using that
technique), it's a harrowing experience. If you know the data, then use VBA
code to cycle through the data and perform the actions...all in the same
form where the user selects the data.

When I attempted to add the VBA from the command button on the continous
form (after opening up the form in hidden mode), I get an error that the
database object is read-only. This does not occur if I open the single
page
form directly and execute the command button.

I have no idea what the VBA code is, or what it's supposed to do, so there
is nothing I can suggest here at the moment.
 
Ken,
Thank you very much for the advice on the recordset vs. form. Is it
possible via command to check a field value from a previous record in the
recordset? I need field values from the previous record to be checked as the
focus is on the current record.

Thanks again for the info and advice.
Bernie
 
In general, yes you can "move" between records in a recordset and read the
data in those fields. The "previous" and "next" of course are defined by how
you sort the recordset.

You can use the form's recordset directly, best to do it via the
RecordsetClone so that you can "move" from one record to another without
changing the appearance of the form's data.

If you provide some more details about what the form's record source is
where the user selects things, and what you want to do with the selections,
I'm sure we can provide some suggestions.
--

Ken Snell
<MS ACCESS MVP>
 
Back
Top