Results 1 to 7 of 7

Thread: Dlookup

  1. #1
    Join Date
    Sep 2003
    Posts
    5

    Unanswered: Dlookup

    Hi

    I have the following used for Access :-

    Dim varX As Variant

    varX = DLookup("[BookedSeat]", "QryBookedSeatCinema1", "[AllSeat] = 'C110'")

    If varX = "C110" Then
    Toggle17.ForeColor = 16711680
    Else
    Toggle17.ForeColor = 255
    End If

    But when I run the Toggle button doe snot change color. Any idea? Pl shelp.

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    At a minimum, Toggle17 should turn red. What kind of control is Toggle17?
    All code ADO/ADOX unless otherwise specified.
    Mike.

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    also useful to try:
    varX = DLookup("[BookedSeat]", "QryBookedSeatCinema1", "[AllSeat] = 'C110'")
    msgbox "varX = " & varX, vbquestion + vbokonly, "Is this what you expected?"
    If varX = "C110" Then ...etc

    izy

  4. #4
    Join Date
    Sep 2003
    Posts
    5
    Originally posted by HomerBoo
    At a minimum, Toggle17 should turn red. What kind of control is Toggle17?
    Toggle17 is a toggle button.

  5. #5
    Join Date
    Sep 2003
    Posts
    5
    Originally posted by HomerBoo
    At a minimum, Toggle17 should turn red. What kind of control is Toggle17?
    yes...it turns red.....but does not turn blue even though I have C110 in my Query

  6. #6
    Join Date
    Sep 2003
    Posts
    5
    Originally posted by izyrider
    also useful to try:
    varX = DLookup("[BookedSeat]", "QryBookedSeatCinema1", "[AllSeat] = 'C110'")
    msgbox "varX = " & varX, vbquestion + vbokonly, "Is this what you expected?"
    If varX = "C110" Then ...etc

    izy
    Hi. Thx.....this works now.......very well....

  7. #7
    Join Date
    Sep 2003
    Posts
    5
    Hi...thx for replying.

    Aft creating a new database, the code seems to be working well.....I am not sure why it did not work in my earlier database.....thx a lot for your time.

Posting Permissions

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