#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    Surrey
    Posts
    0
    Rep Power
    0

    Unhappy VB enquiry for MS ACCESS


    Sorry people if I posted in the wrong place, or even if it doesnt belong on Devshed altogether. But basically i need all the help i can get

    Dim varY As Variant
    Dim varz As Variant

    Dim stringa As String
    Dim stringb As String
    For y = 1 To 1 Step 1
    For x = 1 To 101 Step 1
    stringa = ("txt" & y & "time" & x)
    stringb = ("lblslot" & x)
    varslot2.Value = y
    varslot1.Value = Me.Controls(stringb).Tag
    VarX = DLookup("bookingid", "booking", "[Time] = varslot1.value AND [Date] = date()")
    varslot1.Value = VarX
    varz = DLookup("membernumber", "booking", "[bookingid] = varslot1.value")
    varslot3.Value = varz
    Me.Controls(stringa).Value = DLookup("Surname", "member", "[membernumber] = varslot3.Value")
    If IsNull(VarX) = False Then
    Me.Controls(stringa).Tag = VarX
    End If
    varslot1.Value = Me.Controls(stringb).Tag
    Me.Controls(stringa).BackColor = 7524210
    Me.Controls(stringa).FontBold = 1
    If IsNull(VarX) = True Then
    Me.Controls(stringa).Value = varslot1.Value
    Me.Controls(stringa).BackColor = 16777215
    Me.Controls(stringa).FontBold = 0
    End If
    Next x
    Next y

    What it does is take values from a bunch of hidden fields called lblslot1, lblslot 2 ...lblslot 101 And the tags of these fields contain the relevant time for a golf club tee time system. So the first slot contains 07:30:00 and the last slot contains 17:30:00 - they go up in 6 minute increments.

    THe varslots are also fields that are simply there to store values used in the procedure.

    I just wanted to ask if anybody can help me to rewrite this code so that i dont have to use the lblslot for the time, but a procedure that will automatically put the 6 minutes time increments into the txt_time_ (fields which actually display the times).

    I would like it so that the procedure put it into the tag of these slots.
    Thanks
    (Sorry about the long message)
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    USA
    Posts
    286
    Rep Power
    13
    Try asking at http://www.codeguru.com. :)

    Comments on this post

    • Gran Roguismo agrees
    Jon Sagara

    "Me fail English? That's unpossible!"

IMN logo majestic logo threadwatch logo seochat tools logo