Multiple Switchboards

K

KaiRich

Hi Dave,

Problem: Identify open form (switchboard), change label
value.

This code is based on a command button click, but will
work in other situations - I just wanted to test it before
giving it to you.

This reads what form has the focus (I hope that equates
to 'which one is open' for you), it stores the name of the
focussed form, it changes the unbound label - and then it
displays a message box just to debug.

Sub cmdButton_Click()
Dim CurrentSwitch As Form
Set CurrentSwitch = Screen.ActiveForm
lblTempStore.Caption = CurrentSwitch.Name
MsgBox "Current Form: " & CurrentSwitch.Name
End Sub

Regards,
Kai
-----Original Message-----
Clear DayI have an application that contains multiple
switchboards. I would like to identify each of the
switchboards differently, but I do not know how to
identify which switchboard is open and then update the
unbound label containing the text.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top