Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Populate field based on values in another field

Posted on 2014-12-10
3
Medium Priority
?
123 Views
Last Modified: 2014-12-10
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
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
Bitsqueezer earned 2000 total points
ID: 40492546
Hi,

try it with

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

Cheers,

Christian
0
 

Author Comment

by:SteveL13
ID: 40492591
Didn't work.  Sorry.
0
 

Author Comment

by:SteveL13
ID: 40492611
Whoops!  Yes it did.  I had a typo.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question