Results 1 to 10 of 10
  1. #1
    memento is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    8

    Dlookup Value not saving in table


    HI Guys,

    I have a form and using dlookup functions to populate the form but the data was not save in table.

    The link table where I fetch the data is a dynamic table it change every day.

    Appreciate your response on this
    Attached Files Attached Files

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    I did not download your db but does the DLookup work on your form? Is the control you are using it for a bound control?

  3. #3
    memento is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    8
    Yes Dlookup is working on my form

  4. #4
    memento is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    8
    Yes is a bound control

  5. #5
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Can you post your DLookup Code? And what event is the code firing under?

  6. #6
    memento is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    8
    This is one of the control of the form

    Control Source:

    =DLookUp("Field28","OpenPOLines","Field1='" & [LotNumber] & "'")

    AfterUpdate

    Me.CommodityType = Dlookup ("Field28","OpenPOLines","Field1='" & Me.[LotNumber] & "'")

  7. #7
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Can't make sense of that. I see someone has downloaded your db anyway!

    Good Luck With Your Project.

  8. #8
    memento is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    8
    Thanks for your time

  9. #9
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by memento View Post
    Yes is a bound control


    Quote Originally Posted by memento View Post

    Control Source:

    =DLookUp("Field28","OpenPOLines","Field1='" & [LotNumber] & "'")
    Sorry, but if the Control Source is

    =DLookUp("Field28","OpenPOLines","Field1='" & [LotNumber] & "'")

    the Control is not Bound! For it to be a Bound Control the Control Source has to be a Field in the Form's underlying Table or Query, not a DLookup()!

    You need to Bind the Control to the appropriate Field, using the Control Source, and run the DLookup elsewhere, in an appropriate event.

    Linq ;0)>

  10. #10
    memento is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    8

    Post

    Quote Originally Posted by Missinglinq View Post


    Sorry, but if the Control Source is

    =DLookUp("Field28","OpenPOLines","Field1='" & [LotNumber] & "'")

    the Control is not Bound! For it to be a Bound Control the Control Source has to be a Field in the Form's underlying Table or Query, not a DLookup()!

    You need to Bind the Control to the appropriate Field, using the Control Source, and run the DLookup elsewhere, in an appropriate event.

    Linq ;0)>


    Ok now I understand.

    First:
    Control source must contain the filed in the forms.
    example: Name: LotNumber; Control Source: LotNumber

    Second:
    How to bind?

    Example I will used the Afterupdate of Remarks

    Private Sub Remarks_AfterUpdate()

    Me.Remarks = DLookup("F2", "OpenSOLines", "F1='" & Me.LotNumber & "'")

    End Sub

    Is this correct?

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

Similar Threads

  1. Saving A Calculated Field In A Table
    By HectorTheInspector in forum Forms
    Replies: 2
    Last Post: 10-06-2013, 07:15 AM
  2. Combo Box not saving to table
    By dgriffin in forum Forms
    Replies: 11
    Last Post: 06-08-2011, 03:04 PM
  3. Saving to Table
    By Zerdan in forum Forms
    Replies: 2
    Last Post: 06-07-2011, 08:40 AM
  4. Data Not Saving To Table
    By AUS1960 in forum Forms
    Replies: 2
    Last Post: 05-11-2011, 05:35 AM
  5. record saving twice in table
    By ds_8805 in forum Forms
    Replies: 15
    Last Post: 04-14-2010, 07:16 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