Auto Populate

C

Chantel33

I need my form to auto populate. I have two fields Area and Task. The task
field has a list of task to choose from such as "Assist Others" I need the
other field to Auto populate when a certain task is choosen from the Task
list. If I choose the above task "Assist Others" I want my Area field to
automatically populate "Training". I also need this to show to the same in
the table as i will use these values in queries, and reports. Please help.

Chantel
 
A

Arvin Meyer MVP

Use a Case statement in the AfterUpdate event of the Task control. Something
like (untested):

Private Sub txtTask_AfterUdate()
Select Case Me.txtTask
Case "Assist Others"
Me.txtArea = "Training"
Case "Whatever"
Me.txtArea = "Another Value"
Case Else
End Select
End Sub
 
C

Chantel33

Arvin,

That helps alot, additional question to the:
Case "Whatever"
Me.txtArea = "Another Value"
if i have several Task that should relate to the Area "Training" will this
work. and if so where do i store the task and area in a seperate table or in
the same table?

Right now this is in Excel and there is a long list of area and task, there
might be seven task that relate to one area, right now we are using a
reference and look up formula so when the task is chosen the area auto
populates. =IF(B6="","",VLOOKUP(B6,AA$5791:AB$11556,2,FALSE))
 
A

Arvin Meyer MVP

You can have multiple values for the Task. Use it like:

Case "Assist Others", "Catch Fish, "Gig Frogs"

If there's a large number of choices, use a combobox to chose the Task, and
have it limit the next choices in another combo. Here's an example using
list boxes:

http://www.accessmvp.com/Arvin/Combo.zip
 

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