Results 1 to 4 of 4

Thread: Database problem

  1. #1

    Thread Starter
    New Member Les_Dennis's Avatar
    Join Date
    Aug 2001
    Location
    Out of my depth
    Posts
    4

    Database problem

    I need to make a label visible if a certain word appears in one of the fields in my database. However, the label only becomes visible when I click onto the next record and not when I enter the record itself

    I am using the following code and have tried putting it in the data control and under form load.

    If blah.Text = "blah" Then blahblah.Visible = True
    If blah.Text = "" Then blahblah.Visible = False

    Any ideas where I am going wrong.

    PS. Do any of you guys have jobs because the same people seem to be on here all the time?

  2. #2
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    Put a textbox instead and do the following:

    set the visible property to true
    set the text property to "" (null)
    in the control source property enter the following:
    iif(field = "text", "whatever you want it to display", "")

    field is the field you're comparing against.

    I think this should work.

  3. #3
    Lively Member
    Join Date
    Dec 2000
    Location
    Toronto, Canada
    Posts
    112
    I am not sure if you got the answer that you are looking for but I believe that you need a space in you if statement. if blah.text =
    " " then .... NOT if blah.text = "" then ....

    Lemmie know if that was the problem.

  4. #4
    Frenzied Member vbgladiator's Avatar
    Join Date
    May 2001
    Posts
    1,950
    If you put a space in the quotes then access will be looking for a space.

Posting Permissions

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



Click Here to Expand Forum to Full Width