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!

Change a table default via a form.

Status
Not open for further replies.

RJHolmes

Technical User
Apr 9, 2001
6
US
I have a developed a database to track the number of hours an employee works during any given day. The data is entered via a subform (Hours) linked to a Main Form (Employees).

In order to save time during data input, I've instructed those who input the data to open the Hours table in design view and change the default value to match the date of the data being inputted to the database.

This has worked well during the eighteen months that this has been used. However, with new employees being trained for this position, I've become a little worried about having them have access to the design views.

I was wondering if it is possible to use a form to change the default value in a table. If able to perform this action, the person inputting the data would relieved from inputting the date some 100 to 150 times for each days records.

Thanks, in advance.

 
Why not set the default value to Date()which should insert the current system date? Or Date()-1 for the previous day.

Or alternatively on opening the application open a date selection form (using the calendar control?) to select the date of data entry. When clicking the ok for date selection hide this form so it remains open but out of the way.

Forms!frmName.Visible = False
Then set the default value of the date field in your data entry form to the field in the date selection form.
The Default Value property is set to

[Forms]![frmName]![SelectedDate]

By having a button to re-active the date selection form your users could re-check the selected date and/or change to enter more data. It's a bit crude but quite user friendly.
 
Just got back on-line.

Can not set the default date to Now() because the hard-copy of the data is, at the minimum a day, and at the most four days late in arriving at the data input location.

I do like the Calendar Control solution and have created a form from ActiveX. On this form, I added a command button and placed the code suggested, modified to suit the name that I gave to the created calendar form. In this particular case the code is as follows:

Forms!frmCalCon.Visible = False

I then went to the subform and inserted the code provided in the default value setting of the Record date field (e.g. [Forms]![frmCalCon]![SelectedDate].

When testing this, I find that the date field shows #Name? error. Did I miss something?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top