Populate field based on values in another field

On a form I have a field that may read, "Baseball, Football, Basketball".

If in that string of characters there is "Football", I want a second field to populate with "30".  Otherwise "90"

Here is my oncurrent event code that is not working:

   If InStr(txtGames, "Football") Then
        Me.txtNumber = 30
        Else
        Me.txtNumber = 90
    End If
SteveL13Asked:
Who is Participating?
 
BitsqueezerCommented:
Hi,

try it with

If InStr(txtGames, "Football") > 0 Then

Cheers,

Christian
0
 
SteveL13Author Commented:
Didn't work.  Sorry.
0
 
SteveL13Author Commented:
Whoops!  Yes it did.  I had a typo.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.