Solved

Populate field based on values in another field

Posted on 2014-12-10
3
116 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
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
Bitsqueezer earned 500 total points
Comment Utility
Hi,

try it with

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

Cheers,

Christian
0
 

Author Comment

by:SteveL13
Comment Utility
Didn't work.  Sorry.
0
 

Author Comment

by:SteveL13
Comment Utility
Whoops!  Yes it did.  I had a typo.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now