Auto populate question

J

john.menken

I have a standard form where the user types an Event Name then adds a
Date, Start Time, End Time and so on for that event. The Start time
and End Time fields are combo boxes that pull information from
separate tables. It became evident during testing that some events
happen a lot more than others. For example, an Event called "RMB
Meeting" happens four or five times a month where "Blood Drive" may
only occur once every couple of months. My question is this: Is there
a way I can program my app so when the user types "RMB Meeting" in the
Event Name field, the Start Time will populate with 9:00 AM and the
End Time will populate with 11:00 AM? It would save someone the time
that it takes to make those time selections from the drop down menu.
Here is a graphical depiction of what I am trying to explain.

http://209.200.80.147/Test/rmb.html


Thank you very much.
 
B

bhicks11 via AccessMonster.com

In the AfterUpdate event of the EVENT NAME control put some code something
like:

If me.[Event Name] = "RMB Meeting" Then
me.[Start Time] = "9:00 AM" 'depending on data type
me.[End Time] = "11:00 AM"
me.whatevernextfield.setfocus 'to skip down to next field
End If

Bonnie
http://www.dataplus-svc.com
 
J

John Spencer

If you have a lot of events that have standard times you might consider
a table of possible events with three fields:
EventName
EventStart
EventEnd

Then use a combobox built on the table that shows the EventName as
choices. In the AfterUpdate event of the combobox, you could use some
VBA to grab the value in column(1) and assign that to the start time and
column(2) to the end time.


'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================

In the AfterUpdate event of the EVENT NAME control put some code something
like:

If me.[Event Name] = "RMB Meeting" Then
me.[Start Time] = "9:00 AM" 'depending on data type
me.[End Time] = "11:00 AM"
me.whatevernextfield.setfocus 'to skip down to next field
End If

Bonnie
http://www.dataplus-svc.com

I have a standard form where the user types an Event Name then adds a
Date, Start Time, End Time and so on for that event. The Start time
and End Time fields are combo boxes that pull information from
separate tables. It became evident during testing that some events
happen a lot more than others. For example, an Event called "RMB
Meeting" happens four or five times a month where "Blood Drive" may
only occur once every couple of months. My question is this: Is there
a way I can program my app so when the user types "RMB Meeting" in the
Event Name field, the Start Time will populate with 9:00 AM and the
End Time will populate with 11:00 AM? It would save someone the time
that it takes to make those time selections from the drop down menu.
Here is a graphical depiction of what I am trying to explain.

http://209.200.80.147/Test/rmb.html

Thank you very much.
 
J

john.menken

Thanks very much guys. The code worked superb and I'll keep the other
suggestion in mind as well.
Thanks again.
 

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

Top