Results 1 to 6 of 6
  1. #1
    alsoto is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    67

    DLookup Problem

    I have attached the following code to the on click event of a button on my main form:



    Forms![frmChinsListSFA]![subformChinsListSFA].Form![Quantity] = DlookUp ("[Quantity]", "tblChinsListProcDefaults", "[ProcNo]=" & Forms![frmChinsListSFA]![subformChinsListSFA].Form![procNo] & " AND [ID]=" & Forms![frmChinsListSFA]![subformChinsListSFA].Form![ID])

    The subform (record source is a table) has about 300 records. When I click the button, the update doesn't work except when I highlight a record. Then it updates only for that record and not for the other 299 records.

    Can anybody please tell me why all the records are not updated?

    Thanks,
    Al

    ps I tried hitting Ctrl + A to highlight all the records and then hit the button, but that did not work.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Can't you achieve the result with a join in a query? If this did work, it would be painfully slow.

  3. #3
    alsoto is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    67
    So you think I would be better off using an update query?

    Quote Originally Posted by RuralGuy View Post
    Can't you achieve the result with a join in a query? If this did work, it would be painfully slow.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    If that is what you want to do, yes. I was suggesting a join but if you have an update scheme then use that.

  5. #5
    alsoto is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2009
    Posts
    67

    Update Query Solution

    RG,

    I used an update query as a solution, with form fields as parameters.

    Thanks as always,
    Al Soto

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're welcome Al. Glad we could help.

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

Similar Threads

  1. Problem with DLookup
    By MichealShinn in forum Programming
    Replies: 5
    Last Post: 01-25-2012, 09:08 AM
  2. DLookup problem
    By the_rock in forum Programming
    Replies: 3
    Last Post: 01-11-2012, 02:36 AM
  3. Dlookup problem
    By metronometro in forum Queries
    Replies: 1
    Last Post: 01-07-2012, 12:17 PM
  4. Using Dlookup problem
    By Lupson2011 in forum Access
    Replies: 5
    Last Post: 12-07-2011, 10:33 AM
  5. Dlookup problem
    By CalifDan in forum Reports
    Replies: 4
    Last Post: 12-09-2009, 06:09 AM

Tags for this Thread

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