Textbox on a form

hooby1

Registered User.
Local time
Today, 08:08
Joined
May 9, 2004
Messages
48
Is it possible for a textbox on a form to show a result of a query? For example a query has a sum result and that can be shown in the textbox on the form. Also can you show any result in textbox from a query?
Cheers
 
text box

hooby1,
In design view open the properties box for your textbox. Click on the tab that says Data. The ControlSource is where you enter the details of what you want to bind the control to.

To select the bit you want click on the "..." to open the expression builder then work your way through to your query and select the field, from the relevant query, that contains the data you want.

Hopefully that should do the trick for you.

regards

Ian
 
Hello,
Cheers for the reply, when doing this, the result that is shown is #NAME? in the textbox. This was done with the way you stated. What does this error mean? Could you show an example? Cheers for your help.
 
name field

Hooby,

This means you have bound the text box to a field that the database cant find.

the password form should have both the text boxes unbound as you will search through your records with VB code.

In the example I have posted you need to substitute the successfull message box code for the code you need to open the form you want. The form you are opening should have been built around the query you want the results of.

The idea is if you click cancel the password popup will close. However if you click the continue button the code will run that will search through your table for the matching user id and password. if successful it will open the query based form for you.

hope this helps
ian
 

Users who are viewing this thread

Back
Top Bottom