Results 1 to 8 of 8
  1. #1
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402

    dlookup problem

    Hi Guys

    Hi Guys

    I have a form for my asset database that populates the name of the asset from active directory and compares that name against a table called "assets" then pulls in all the support requests listed against it.

    the code below works really well

    Me.Text26 = DLookup("[AssetID]", "Asset", "[AssetName]= '" & [DomainComputerName] & "'")



    what I can't do is this

    I need to be able to dispose of each asset when they have reached their end of life, the replacement assets will have the same name as the asset we just disposed of.

    I have a field in the asset table called "assetdisposedof" that's a yes/no field. what I need to be able to do is amend the lookup to include [assetdisposedof]=false" in the above.

    Me.Text26 = DLookup("[AssetID]", "Asset", "[AssetName]= '" & [DomainComputerName] & "'" & "[assetdisposedof]=false") produces "syntax error (missing operator) I can't get my head around how to only lookup names that are set to false.


    Many Thanks

    Steve

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    2,977
    Try:
    Me.Text26 = DLookup("[AssetID]", "Asset", "[AssetName]= '" & [DomainComputerName] & "'" & AND "[assetdisposedof] = false")
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi Bob

    thanks for the reply

    when using
    Me.Text26 = DLookup("[AssetID]", "Asset", "[AssetName]= '" & [DomainComputerName] & "'" & AND "[assetdisposedof] = false")

    I get "Compile error Expected:expression"

    Steve

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    2,977
    Guessing a bit. Try:
    Me.Text26 = DLookup("[AssetID]", "Asset", "[AssetName]= '" & [DomainComputerName] & "'" AND "[assetdisposedof] = false")
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi Bob

    I have done so and get "run-time error '13': Type mismatch

    steve

  6. #6
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi All

    god, im so dumb I have managed to fixed this, the form was based on a query, so just added the assetdisposedof = false there.

    im really sorry for taking your time Bob, many many thanks for your help

    Steve

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    2,977
    Well until someone passes by who actually knows what they are doing, shall we try:

    Me.Text26 = DLookup("[AssetID]", "Asset", "[AssetName]= '" & [DomainComputerName] & "' AND [assetdisposedof] = false")
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  8. #8
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    2,977
    Quote Originally Posted by sdel_nevo View Post
    Hi All

    god, im so dumb I have managed to fixed this, the form was based on a query, so just added the assetdisposedof = false there.

    im really sorry for taking your time Bob, many many thanks for your help

    Steve
    Ok Steve. No problem. Thanks for letting us know. Good luck.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Problem with DlookUp
    By zylosan in forum Programming
    Replies: 10
    Last Post: 10-18-2013, 07:46 AM
  2. DLookup problem
    By Paul Netzel in forum Programming
    Replies: 4
    Last Post: 07-14-2013, 12:22 PM
  3. DLookUP problem
    By Symlink in forum Access
    Replies: 7
    Last Post: 03-28-2013, 11:03 AM
  4. DLookup problem
    By the_rock in forum Programming
    Replies: 3
    Last Post: 01-11-2012, 02:36 AM
  5. Dlookup problem
    By metronometro in forum Queries
    Replies: 1
    Last Post: 01-07-2012, 12:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums