PC Review


Reply
Thread Tools Rate Thread

choice of automatically populating field based on drop-down list

 
 
Kyle
Guest
Posts: n/a
 
      27th Dec 2006
I'm sorry if this is a simple question, but searching the newsgroup has
turned up nothing for my specific need.

I am creating a database to handle request for special security guard
needs at the school where I am currently contracted. In this database,
I have a form the Security captain fills out which will generate the
detail request as well as the memo for the security company from which
they will charge us.

Here's the tricky part: I have one field (Event_Type) in the primary
table from which the captain will choose the event type: special event,
IS project, or Facilities project. I want to be able to automatically
populate the field Budget_Charged only if the Event_Type is "Special
Event", but manually enter the budget number if the choice is "IS
project" or "Facilities project".

If it were as simple as one Event_Type = one budget number, that would
be simple, but the Event_Type "IS project" or "Facilities project"
could be charged to any one of 123 budget numbers.

Ideas? Suggestions? Should I toss it in now?

Thanks!

 
Reply With Quote
 
 
 
 
Steve Schapel
Guest
Posts: n/a
 
      27th Dec 2006
Kyle,

Is this what you mean?... On the After Update event of the Event_Type
control (I assume this is a Combobox?)...

If Me.Event_Type = "Special Event" Then
Me.Budget_Charged = 666
Else
Me.Budget_Charged = Null
End If

--
Steve Schapel, Microsoft Access MVP

Kyle wrote:
> I'm sorry if this is a simple question, but searching the newsgroup has
> turned up nothing for my specific need.
>
> I am creating a database to handle request for special security guard
> needs at the school where I am currently contracted. In this database,
> I have a form the Security captain fills out which will generate the
> detail request as well as the memo for the security company from which
> they will charge us.
>
> Here's the tricky part: I have one field (Event_Type) in the primary
> table from which the captain will choose the event type: special event,
> IS project, or Facilities project. I want to be able to automatically
> populate the field Budget_Charged only if the Event_Type is "Special
> Event", but manually enter the budget number if the choice is "IS
> project" or "Facilities project".
>
> If it were as simple as one Event_Type = one budget number, that would
> be simple, but the Event_Type "IS project" or "Facilities project"
> could be charged to any one of 123 budget numbers.
>
> Ideas? Suggestions? Should I toss it in now?
>
> Thanks!
>

 
Reply With Quote
 
Kyle
Guest
Posts: n/a
 
      28th Dec 2006
Steve Schapel wrote:
> Kyle,
>
> Is this what you mean?... On the After Update event of the Event_Type
> control (I assume this is a Combobox?)...
>
> If Me.Event_Type = "Special Event" Then
> Me.Budget_Charged = 666
> Else
> Me.Budget_Charged = Null
> End If


My God - a simple IF/ELSE statement...elegant, wonderful! I've been
away from code writing too long; the brain's gone mushy...

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
populating neighbouring columns based on drop-down choice mikeg Microsoft Excel Programming 1 3rd May 2010 07:06 AM
Populating other cells based on a choice from a drop-down list Ryan Microsoft Excel Misc 1 19th Dec 2008 08:30 PM
Drop down list based on choice of another dropdown Amy Microsoft Excel Misc 2 23rd Jan 2008 08:39 PM
Populating a field based on THREE drop down lists.... =?Utf-8?B?TWFjTnV0?= Microsoft Access Forms 6 22nd Jul 2005 02:13 PM
...display a drop down list in one field based on a choice in another field. Christine Microsoft Access Macros 1 21st Aug 2004 12:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:10 AM.