Default Values in Form from Table

shaggy

Registered User.
Local time
Today, 20:31
Joined
Sep 9, 2002
Messages
41
I have a form the runs reports based on a 2 values entered manually into text boxes. I would like to set default values for these boxes, but the values change twice daily.

I've written a make table query that creates a table with the values I would like (only 1 record).

I've inserted a macro that runs the query into the on load event of the form.

I entered the table and field references into the default value properties of the text boxes.

The macro runs the query and the table is created, but #Name? shows in the text boxes instead of the value from the table.

The form works when the values are entered manually.

The only thought I had was that I'm not specifying which record I want even though there is only one. Do I have to create a primary key and use that in the default value reference?

Thanks
 
There is only 1 user. The form is normally only opened twice a day. Once when new data is imported form an outside application, and then again when data is exported. Reports are run on both import and export data using the defaults. Occasionally the defaults will have to be overridden to re-run reports or to run "on request only" reports.

The default values are the Max Import and Max Export dates.

I change things around a bit and it works now, but I can't override the default.
Instead of getting the default values from a table I bound the form to a query that gets the values. I set the Record Source property for the form to the query, and the Control Source properties for the text boxes to the fields.

How can I allow the user to change the value from the default?
 

Users who are viewing this thread

Back
Top Bottom