Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 124
  • Last Modified:

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
0
SteveL13
Asked:
SteveL13
  • 2
1 Solution
 
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

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now