Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2010
    Posts
    9

    Unanswered: Populate other fields in same table using if then statement

    I have table called RaceEntry2

    Numeric Fields are lapNo, Lap1 , Lap2, Lap3 , Lap4, Lap5

    RaceTime = "General date field"

    If LapNo = "1" then lap1 = Racetime and Lap"2 -5" must be blank (Null)
    What should the VBA code be in a button to do this pls.
    I would like to combine this function and have something like

    Code:
    If Me.Lapno = "1" Then me.lap1 = me.racetime and Me.Lap2 = Null and Me.Lap3 = Null and Me.Lap4 = Null and Me.Lap5 = Null
    
    if lapno = "2" then me.Lap2= me.Racetime and me.lap1 = Null and Me.Lap3= Null and Me.Lap4 = Null and Me.Lap5 = Null  etc etc
    Last edited by Neelsfer; 06-09-12 at 20:23.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    having a single row with Lap1,Lap2...LapN, smacks of bad design

    what I'd suggest you do is store the lap times as individual rows

    eg
    RaceID
    CompetitorID
    LapNo
    ElapsedTime
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •