Webhosting in Pakistan
Results 1 to 6 of 6

Thread: DLook UP formula

  1. #1
    khangf7 is offline Junior Member
    Last Online
    16th February 2017 @ 05:30 PM
    Join Date
    05 Jan 2016
    Location
    Jeddah
    Age
    37
    Gender
    Male
    Posts
    18
    Threads
    5
    Credits
    49
    Thanked: 1

    Default DLook UP formula

    Webhosting in Pakistan
    Assalamualaikum, may access ko buhat enjoy karta ho buhat achaa program hai, liken mujhay DLook Up formula agar koi bata sakey to may aik DCS (Documents Control System) upgrade karney jaraho. s may app bhayon ka madad chaye ho ga.

    Meharabi ho agar Delookup ka formula bajdy.

    Wassalam apka bhai Asghar khan
    Attached Images Attached Images    

  2. The Following User Says Thank You to khangf7 For This Useful Post:

    bomb (7th January 2016)

  3. #2
    khangf7 is offline Junior Member
    Last Online
    16th February 2017 @ 05:30 PM
    Join Date
    05 Jan 2016
    Location
    Jeddah
    Age
    37
    Gender
    Male
    Posts
    18
    Threads
    5
    Credits
    49
    Thanked: 1

    Default

    may aik Junior Member ho private massage nahi baj sakta abdulraof sahab.... jo ata hai wo sika sakta ho, leken kuch relations awar DLookup nahi ata.....

  4. #3
    AsifSattarvi's Avatar
    AsifSattarvi is offline Senior Member+
    Last Online
    2nd April 2017 @ 02:46 PM
    Join Date
    20 May 2012
    Gender
    Male
    Posts
    6,593
    Threads
    104
    Credits
    23,068
    Thanked
    960

    Default

    Please try it.
    Sooner or later, you will need to retrieve a value stored in a table. If you regularly make write invoices to companies, you will have a Company table that contains all the company's details including a CompanyID field, and a Contract table that stores just the CompanyID to look up those details. Sometimes you can base your form or report on a query that contains all the additional tables. Other times, DLookup() will be a life-saver.

    DLookup() expects you to give it three things inside the brackets. Think of them as:

    Look up the _____ field, from the _____ table, where the record is _____

    Each of these must go in quotes, separated by commas.

    You must also use square brackets around the table or field names if the names contain odd characters (spaces, #, etc) or start with a number.

    This is probably easiest to follow with some examples:

    you have a CompanyID such as 874, and want to print the company name on a report;
    you have Category such as "C", and need to show what this category means.
    you have StudentID such as "JoneFr", and need the student?s full name on a form.

    Example 1:

    Look up the CompanyName field from table Company, where CompanyID = 874. This translates to:

    =DLookup("CompanyName", "Company", "CompanyID = 874")

    You don't want Company 874 printed for every record! Use an ampersand (&) to concatenate the current value in the CompanyID field of your report to the "Company = " criteria:

    =DLookup("CompanyName", "Company", "CompanyID = " & [CompanyID])

    If the CompanyID is null (as it might be at a new record), the 3rd agumenent will be incomplete, so the entire expression yields #Error. To avoid that use Nz() to supply a value for when the field is null:

    =DLookup("CompanyName", "Company", "CompanyID = " & Nz([CompanyID],0))

    Example 2:

    The example above is correct if CompanyID is a number. But if the field is text, Access expects quote marks around it. In our second example, we look up the CategoryName field in table Cat, where Category = 'C'. This means the DLookup becomes:

    =DLookup("CategoryName", "Cat", "Category = 'C'")

    Single quotes within the double quotes is one way to do quotes within quotes. But again, we don't want Categoy 'C' for all records: we need the current value from our Category field patched into the quote. To do this, we close the quotation after the first single quote, add the contents of Category, and then add the trailing single quote. This becomes:

    =DLookup("CategoryName", "Cat", "Category = '" & [Category] & "'")

    Example 3:

    In our third example, we need the full name from a Student table. But the student table has the name split into FirstName and Surname fields, so we need to refer to them both and add a space between. To show this information on your form, add a textbox with ControlSource:

    =DLookup("[FirstName] & ' ' & [Surname]", "Student", "StudentID = '" & [StudentID] & "'")

    Quotes inside quotes

    Now you know how to supply the 3 parts for DLookup(), you are using quotes inside quotes. The single quote character fails if the text contains an apostrophe, so it is better to use the double-quote character. But you must double-up the double-quote character when it is inside quotes.

  5. #4
    khangf7 is offline Junior Member
    Last Online
    16th February 2017 @ 05:30 PM
    Join Date
    05 Jan 2016
    Location
    Jeddah
    Age
    37
    Gender
    Male
    Posts
    18
    Threads
    5
    Credits
    49
    Thanked: 1

    Default

    بهت بهت مهرابانی جناب اپ نئ میرا کام اسان کیا. میڼ بهت مشکور هو.

    - - - Updated - - -


  6. #5
    khangf7 is offline Junior Member
    Last Online
    16th February 2017 @ 05:30 PM
    Join Date
    05 Jan 2016
    Location
    Jeddah
    Age
    37
    Gender
    Male
    Posts
    18
    Threads
    5
    Credits
    49
    Thanked: 1

    Default

    Sir, how to put Dlookup on combo box my concept is (if combo box = name then Badge# , Working location and contact number appear automatically)

  7. #6
    khangf7 is offline Junior Member
    Last Online
    16th February 2017 @ 05:30 PM
    Join Date
    05 Jan 2016
    Location
    Jeddah
    Age
    37
    Gender
    Male
    Posts
    18
    Threads
    5
    Credits
    49
    Thanked: 1

    Default

    Webhosting in Pakistan
    ایی ٹی دنیا کے تمام ممبرز کو میرے طرف سے السلام علیکم۔عزیز برادرم کرام مجھے اپ دوستوں کاسپورٹ کا طلبگار ھوں۔ مجھے کمبو بکس میں (ڈ-لوک اپ) کے ذریعے سرچ کرنا ھے۔ مھربانی ھوگی اگر مجھے کمبو میں (ڈ-لوک اپ) کا فارمولا استعمال کرنے میں مدد کرے تو مھرابانی ھوگی

Similar Threads

  1. Excel tip (Hidde formula in formula bar in excel)
    By Honour12 in forum Urdu Tutorials & Designing
    Replies: 14
    Last Post: 31st May 2016, 11:06 AM
  2. Solved sum formula
    By waqas urdu in forum Solved Problems (IT)
    Replies: 11
    Last Post: 9th July 2012, 10:24 PM
  3. Formula
    By sabir sami in forum Ask an Expert
    Replies: 3
    Last Post: 2nd July 2011, 12:05 PM
  4. koi esa formula hay
    By sabir sami in forum Ask an Expert
    Replies: 3
    Last Post: 2nd June 2011, 03:37 PM
  5. Need A Formula
    By pashathc in forum Ask an Expert
    Replies: 1
    Last Post: 1st January 2009, 03:06 PM

Bookmarks

Posting Permissions

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