Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query based Text Box

Status
Not open for further replies.

brandysoda

Programmer
Apr 14, 2003
9
US
Can a Text Box get its value based on a query ? I have a text boxes, combo boxes and a command button on a form. When the user clicks the command button, I want a query to run (a sum query) and the result to be diplayed in one of the text boxes.

Can someone please help me figure this one out ? Thanks !
 
let's imagine that you have a sales database and a form for calculating the sales value of an item.
Your table contains the PrtNum, the Price, the Quan.. so the query will be PrtNum, Price, Quan,
on your form you have:
Part No. Price. Quan. Total.
12345 12.50 2 25.00
The 'total' will be calculated when the 'quan' has been entered so use the After_Update event of 'quan' and enter:
Me.Total = Me.Price * Me.Quan
Providing the names of your textboxes are as shown.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top