[AccessD] Trouble referencing a control on another form

Arthur Fuller fuller.artful at gmail.com
Sun Oct 9 14:43:06 CDT 2011


I'm having trouble with the following scenario:

I'm in one form (call it FormA). A button there opens another form (FormB),
which displays a list of records and a pair of buttons (Copy and Close).
The code in FormA opens FormB in dialog mode. The general idea here is that
the user selects a record on FormB and hits the Copy button, whose code
merely says "Me.Visible" = False. The code on the Close button closes the
form.
At this point, we are back on FormA, If FormB is still loaded, then I want
to copy certain of its controls to controls of the same name on FormB.

I've tried several approaches such as:

With Me
      .MachineOrPress = Forms("FormB).MachineOrPress
End With

I also tried;

Dim frm as form
Set frm = Forms("FormB")
With Me
      .MachineOrPress = frm.MachineOrPress
End With

In both cases, all I can see in Intellisense is the properties of FormB --
not the list of controls.

I know there has to be a simple way to to refer to  FormB's controls, but so
far I haven't got it, and if I don't it soon I'll scrap this approach and
use a recordset instead.

Can anyone help me sort this out?

TIA,
Arthur



More information about the AccessD mailing list