default value

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

Guest

Does anyone know how to make a form select a default value from a quire? I
have tried to change the default value in the properties of my text box with
out luck. My form is created by a quire that sorts its criteria by a selected
record in a table. The problem is that I want the form to automatically enter
in this criteria on creating a new record. Please help
 
I don't know about directly from a query, but this is a way I have used:
1. Write a function that executes the query and returns the value you want.
2. Make the function the default value. In the default value property like:
= Get_My_Value(anyArgsYouNeed)
3. The problem is getting the value for any parameters the query needs,
particularly when you open the form. For that, you would have to write some
code in the On Load or On Open events of the form to establish the values.
After that, you would have to create some code somewhere in the form to
capture those values for the function. My suggestion would be to create form
level variables to hold the values you need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top