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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get Default value on a Form from Query

Status
Not open for further replies.

McWhorter

Technical User
Jul 18, 2002
21
0
0
US
I have a form set up for data entry. I want one of the numeric fields to have a default value of a field in another query. I've tried to set it in the "properties" box of that field with no luck. I then tried to set it in the "On Load" event of the form. I used the following code.

SIRF_Num = [Next_SIRF_Num]!NEXT

SIRF_Num is the field on the form I want to set.
Next_SIRF_Num is the name of the simple query where the default value is.
NEXT is the field containing the default value.

 
I think that you need to open the recordset containing the default value, set the value and close it. I would write the code on an 'on click,' see that it works and then cut and paste to the 'on load.'

Rollie E
rollie@bwsys.net

If you need code for this, email me and I will send it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top