Help with InStr() function

George Too

Registered User.
Local time
Today, 15:25
Joined
Aug 12, 2002
Messages
198
I have these statements which load the appropriate subform depending on the entry selected in a combo box.
The problem is that the function finds both strings to be the same and loads the wrong subform for the second statement. How can I make the function "see" the difference b't both statements?

ElseIf InStr(1, Brand, "Gourmet Supreme" ) Then
Me.childHigh.SourceObject = "subfrmColorsHigh_GourmetSup"
ElseIf InStr(1, Brand, "Gourmet Supreme Decaf") Then
Me.childHigh.SourceObject = "subfrmColorsHigh_GourmetSupDecaf"

Thanks,
George
 
Swap them round.

Code:
ElseIf InStr(1, Brand, "Gourmet Supreme Decaf") Then 
    Me.childHigh.SourceObject = "subfrmColorsHigh_GourmetSupDecaf"
ElseIf InStr(1, Brand, "Gourmet Supreme" ) Then 
    Me.childHigh.SourceObject = "subfrmColorsHigh_GourmetSup"
 
Thanks man, that worked! :D
 

Users who are viewing this thread

Back
Top Bottom