Results 1 to 7 of 7

Thread: Dlookup (2002)

  1. #1
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Dlookup (2002)

    Hi,

    I have frmSkilledCommunicationTool which is bound to a query based on tblSkilledClinicalCommunicationTool.. I am trying to set different areas of the form to be enabled based on choices made in tblVentilatorIVServices. tblVentilatorIVServices contains check boxes that the user checks if the service is not being used. An example is [IVServices]. So, if the value in [IVServices]=-1 areas of frmSkilledCommunicationTool are disabled, otherwise they are enabled. I've tried using Dlookup in the load event of the form but have had no luck getting the code correct. Is the correct approach and if so I could use some help with the code.

    Thanks!

    Leesha

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dlookup (2002)

    It's hard to help if we don't know what the code is... <img src=/S/blackteeth.gif border=0 alt=blackteeth width=20 height=20>

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Dlookup (2002)

    OK, so don't laugh at my very lame attempt at doing this. I'm copying code you gave me about a year ago to use when looking up a password and obviously don't have a clue. This is what I've got so far but I get an error that an expression is needed.

    IF DLookup("IVServices", "tblVentilatorIVServices", =-1) Then

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Dlookup (2002)

    It should be

    If DLookup("IVServices", "tblVentilatorIVServices") = True Then

    This assumes that tblVentilatorIVServices has only one record. If you want to look up IVServices in a specific record, you must specify a where-condition as third argument.

  5. #5
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Dlookup (2002)

    Wow!! I wasn't too far off! There is hope yet.

    There is only one record per choice so this will do the trick.

    Thanks Hans,
    Leesha

  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Dlookup (2002)

    You are getting better Leesh.

    Keep it up, practice makes perfect.

  7. #7
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Dlookup (2002)

    Thanks Pat! I still can't code to save my life, defining parameters etc. but my queries and what I can make the do have come a long way!!

    Leesha

Posting Permissions

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