choice of automatically populating field based on drop-down list

K

Kyle

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!
 
S

Steve Schapel

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
 
K

Kyle

Steve said:
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...
 

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