I have a form with a number of textboxes that hide and unhide depending on a number or Laps of a Race. Currently I have this code to make them hide and unhide:
Expand|Select|Wrap|Line Numbers
- Dim LapBox as String
- For x = 1 To 9 'For each possible lap
- LapBox = ("txtLap" & x) 'Reference the specific lap's textbox
- If Laps >= x Then 'If the text box is required
- With Me(LapBox) 'Using the Specific Textbox
- .Visible = True 'Make it visible
- End With
- Else 'If it is not required
- With Me(LapBox)
- .Visible = False 'Make it invisible
- End With
- End If
- Next x 'Go to next text box
The RaceDriverID comes from lstRaceDriver and the Lap is relative to the text bos it is going into, ie: Lap 1 time goes into the 1st text box, and the Lap Time is stored in tblLapTimes along with the RaceDriver ID, Lap number and LapID.
All help is much appreciated,
NDayave