Auto fill in on selection

  • Thread starter Thread starter Gary W. Graley
  • Start date Start date
G

Gary W. Graley

A special situation I have;

Contact table with names associated with a Customer table
Both are associated via ContactID and CustomerID fields to anothe
table called a Phonelog.

My problem is, while keeping things nice and separate in their ow
little worlds, tables that is, if things change, such as happens i
contact world, people move from one company to another and when yo
update the Contact table for that person, the records for the Phonelo
now appear to be contradictory because the comments would be directe
to things from that person's previous employer.

SO, what I want to do goes against keeping things separate, I want t
at the time of recording a Phonelog entry;
Select a person's name, which is tied also to the Customer table
and based on that selection;
Fill in the blanks fields in the Phonelog table, so it becomes
snapshot in time.

What's the best way to have Access populate the fields based on
selection from a dropdown?

Hope the above made some sense, appreciate any help.
G
 
SO, what I want to do goes against keeping things separate, I want to
at the time of recording a Phonelog entry;
Select a person's name, which is tied also to the Customer table
and based on that selection;
Fill in the blanks fields in the Phonelog table, so it becomes a
snapshot in time.

What's the best way to have Access populate the fields based on a
selection from a dropdown?

Use some VBA code in the AfterUpdate event of the Combo Box to
populate the other fields:

Private Sub cboCustomer_AfterUpdate()
Me!txtThisField = cboCustomer.Column(2)
Me!txtThatField = cboCustomer.Column(3)
End Sub

Include all the fields you need to copy in the combo box's Row Source
query; the Column() property is zero based, so the code above will
copy the third and fourth fields in the query.
 
Thanks John, I'll give that a go and see how it works.

I don't seem to get any emails alerting that I've had a response to my
threads, must be the forum isn't working? I periodically check threads
I have to see if there are any new replies, otherwise I'd have been
back here sooner.

G2
 
Back
Top