Auto populate a date field in form during data entry

shellz

New member
Local time
Today, 12:22
Joined
Aug 14, 2015
Messages
3
Hi,
I have created a basic Volunteer Events and Hours Volunteered tracking database.

I created a form Volunteer Hours to allow an end user to use that form to record the volunteer and hours volunteered on a specific Event. There are two tables needed in the form Volunteer Hours to be used for the end users to record the Event, Volunteer, Date and Hours. The form has drill down fields from two tables:
Table A - Volunteer Events (event name, date, descr, owner, co-owner, loc, status)
Table B - Volunteers (name, co, div, emp#,title)

I want to be able to select the Volunteer Event and have the event date automatically populate in the Volunteer Hours form date field when the Event is selected to eliminate the end user from having to enter the date in.

Also; I would like to be able to add more than one volunteer at a time to an event on the form, this would also decrease the data entry time.

Are one or both of these things possible? Any help is greatly :banghead:
 
I'm assuming your "drill down" fields are combo boxes ?
If so and if your field names and table names are as shown there are a couple of things I would change now to avoid confusion and malfunctions.

1. Avoid spaces and special characters in your field and table names.
2. name , date and possibly some of your other field names are reserved names in access and will lead to problems.

Back to your problem - using the combo box , if when you select the VolunteeredEvent you include the EventDate as a column, you can set the StartDate to that value in the after update event on the form.

Assuming your combobox to be called cmbEvent, and your StartDate field control to be called txtStartDate you would use code something like

Code:
Private Sub cmbEvent_AfterUpdate()

Me.txtStartDate = cmbEvent.Column(2)

End Sub
Where the column number is the one your start date is stored.

Finally I would also give your Events table a unique ID field such as EventID - this will really help with future things you will want to do!
 
Thanks for the responses guys!

I didnt give all the field names but the record id's are there also and the table names are actually without spaces. I just typed them different in the post. Sorry for the confusion.

I will try your suggestions and see what happens. Will let you know

Thanks a million! :-)
 
For your second half of the problem, you might want to explore using a List Box. It can be set up to select multiple entries in a list.
 

Users who are viewing this thread

Back
Top Bottom