Open form from switchboard and assign recordsource from selection

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I want to click a button on the switchboard and have it
open a form and assign the recordsource, which will be
based on the selection that is made. I am having a
problem with assigning the str. I am not sure what the
myControl part should be. I have tried to assign it the
names of the buttons, option1, option2, etc and the name
that the switchbord has for it. This is what I have so
far:

Dim str As String
str = Forms!SwitchBoard.Form.[myControl?]
'MsgBox Forms!SwitchBoard.Form.ActiveControl
Select Case str
Case "option1?"
Me.RecordSource = "Active"
Me.Requery
Case "everyone?"
Me.RecordSource = "All"
Me.Requery
End Select

Also what should come after the case. Should it just be
the name of the myControl or should it be something
like "myControl = ..." or should it be the whole str. I
want it to be based on the button that is choosen from
the switchboard.
 
Dan, I attempted to answer your original post you sent on the 19th. Did
that not answer your question? It's better to continue a thread then post
the same question days later.
 
Back
Top