Auto lookup of additional fields.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am working on a project where up to three teachers can contribute to the
preparation of some digital materials. I have structured my database so that
there are three look-up fields in the table of "digital materials", each one
looking up a teacher from a table listing all teachers and their contact
details.

What I'd like to be able to do is, in the form showing the digital
materials, select the tutors from three drop-down lists (i.e. a combo boxes),
but then three other controls on the form next to these boxes automatically
display their email addresses. I'm told this will need some visualbasic
programming. Is this right, and can anyone provide me with code that might
work?

And, by the way, I've worked out how to achieve this using many-many
relationships and subforms, but feel it adds unneccessary complexity to the
database, so would really like a way around it.

Thanks for any help

Rhys
 
If the E-Mail address is a hidden column in the teachers combobox then you
can make the control source of the box at the side
=ComboboxName.Column(1)
the 1 assumes that e-mail address is the 2nd column in the combo box.
If the E-Mail address is in a table and not in the combo box then you can
set the control source of the box at the side to
=DLookUp("E-MailAddress","TeacherTable","TeacherName = '" & ComboxBox & "'")
 
Thanks for this - looks like it should work. but I'm a bit unclear about when
I should use square brackets, quotes, parenthesis etc... in order to get the
syntax right.
 
Back
Top