Jake Jake - 1 year ago 58
SQL Question

Link Textbox to Query Column

I have a query which has the following fields


Sum Of the Board Feet

Sum of the Board Price

What I am trying to do is populate a text box using the information in the above query specifically the Sum of the Board Feet

I am new to coding in VBA so researching I was unsure that I should be looking for. Help would be greatly appreciated

Answer Source

Most likely you would be better off using DSum in an expression for the textbox like:

=DSum("[NameOfYourFieldWithBoardPrice]","[YourOrderDetailsTable]","[OrderID]=" & [Forms]![FMain_Orders]![OrderID] & "")

or, if the textbox is on FMain Orders:

=DSum("[NameOfYourFieldWithBoardPrice]","[YourOrderDetailsTable]","[OrderID]=" & Me![OrderID] & "")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download