Save the result of DLookup funcion in a table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • irslan rafique
    New Member
    • Oct 2014
    • 40

    Save the result of DLookup funcion in a table

    Hi,
    I an using DLookup in a unbound text box and retrieving a correct value as a result. At the same time I want to save this result in other control source field in same form.
    Please assist me.

    Thanks
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3653

    #2
    Code:
    Me.TextBox1 = Me.TextBox2

    Comment

    • irslan rafique
      New Member
      • Oct 2014
      • 40

      #3
      Thanks but it didn't work. I want to save in a control source field not in text box.
      Please help

      Comment

      • twinnyfo
        Recognized Expert Moderator Specialist
        • Nov 2011
        • 3653

        #4
        The text box must be bound to the field in the table.

        Comment

        • irslan rafique
          New Member
          • Oct 2014
          • 40

          #5
          i don,t understand. So sorry for being so childish. Can you explain it please? Thanks

          Comment

          • irslan rafique
            New Member
            • Oct 2014
            • 40

            #6
            Please some help me. I will be very thankful to you.

            Comment

            • twinnyfo
              Recognized Expert Moderator Specialist
              • Nov 2011
              • 3653

              #7
              Please explain what it is that you need help with. Having a form with text controls bound to a table is basic DB design. I'm not sure how simpler I can explain it.

              I'm not sure I understand what it is that you want to do.

              Please explain in greater detail.

              Comment

              • irslan rafique
                New Member
                • Oct 2014
                • 40

                #8
                I have a form based on query. On form i am retrieving data from another table using DLookup in a unbound text box. So i want to save the result of DLookup in another field on same form and that is actually a record source of a main table.
                Please take out me from this problem.
                Thanks

                Comment

                • twinnyfo
                  Recognized Expert Moderator Specialist
                  • Nov 2011
                  • 3653

                  #9
                  So i want to save the result of DLookup in another field on same form and that is actually a record source of a main table.
                  First, you can't have one form that has the record source of both a query and another table. You must find another way to do that. You could use a subform, but it sounds like your are trying to do something very easy in a very difficult way.

                  How are the table and query related? Do they have a matching index that you can use to find the proper field in the table?

                  What is the purpose of these actions, so we can understand what you are trying to do and offer different options/solutions that would fit your needs.

                  Comment

                  • irslan rafique
                    New Member
                    • Oct 2014
                    • 40

                    #10
                    i have a table (main).Query is created on main table and form is created on query.I am using a control source field(Consignee 's ID) to retrieve 4 different commissions from another table (Consignees).An d I need one commission of them that must go to a new field(commissio n) in the form for further calculations.
                    I am using DLookup function in text boxes to retrieve 4 different commissions.
                    So please assist me.
                    Thanks

                    Comment

                    • twinnyfo
                      Recognized Expert Moderator Specialist
                      • Nov 2011
                      • 3653

                      #11
                      Irslan,

                      Please explain where the value is to be saved--not "in a table". You need to explain where you query is coming from (you said table MAIN), but where is the result of your lookup supposed to be saved. I can't help you if you don't provide the basic information of what you are trying to do.

                      Comment

                      Working...