Solved

Populate field based on values in another field

Posted on 2014-12-10
3
118 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
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

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…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

808 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