Is a Select Case statement like this possible?

gold007eye

Registered User.
Local time
Today, 07:48
Joined
May 11, 2005
Messages
260
I have a subform that I am trying to use for 2 differnent forms. "Provider Information - I" & "Provider Information - G". What I need to do though is have the subform check to see which form it is currently linked to / open. Then based on which form is open run If/Then statement code specific to that form (Main Form).

Here is what I'm trying to accomplish not sure how to do it or if it is possible:
Code:
Dim CurrentForm As Variant

CurrentForm = CurrentProject.AllForms("Not sure what to put here because I'm not listing the specific form here I want this section to figure out which form IS currently loaded").IsLoaded

Select Case CurrentForm
    Case "Provider Information - I"
        MsgBox "Provider Information - I Form is currently open", vbOKOnly, "I Provider Test"
    Case "Provider Information - G"
        MsgBox "Provider Information - I Form is currently open", vbOKOnly, "G Provider Test"
End Select

Can someone help me figure this out please so I don't have to create a seperate subform for each of the 2 main forms.
 
Are you simply trying to determine Me.Parent.Name??
 
Hmm.m. let me try that out. :) Maybe that is what I am looking for. Can I implement that into a Select Case statement?
 

Users who are viewing this thread

Back
Top Bottom