Running Queries from a Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table that contains volumes by product and by month and I am trying
to create a form where users choose their product and month and when the user
clicks the calcluate button the volume is returned into the volume field on
the form. I dont want the user to see the query running, just the correct
value appearing in the volume feild.

What is the easiest way to do this?

Thanks in advance for your help!!
 
In the click event of the button put something like this

[YourFieldName] = DLookUp("[Volume]","Your Volumes Table","[Product] = '" &
Me.Product & "' And [Month] = '" & Me.MonthName & "'")

Me.Product and Me.MonthName are the boxes on your form that contain the
Product and Month information (assuming MonthName is Text Like January or Jan
etc.)
 
Back
Top