Problem with Query or code?

G

Guest

I have a combo box(tech name) with its row souce query2. Query2 pulls
Tech_name; Tech_email; Tech_PhoneNumber from my tech table. I am running this
after update:

Private Sub Technician_AfterUpdate()
[TECHNICIAN_PHONE] = Technician.Column(2)
[TECHNICIAN_EMAIL] = Technician.Column(1)
End Sub

Basicly what I want it to do is after you select the name of the technician
the Technician_phone and Technician_Email are auto inputted. The problem is
only the value in column 1 is works. What I mean is the Technician_phone is
not updated whil the Technician_email is. Running the query shows both
columns populated But for some reason im not able to pull data from the
second column.
 
S

Steve Schapel

Donald,

I assume that Technician is the name of the combobox, and not tech name
as you started off with? The only thought I have on the specific
question is that perhaps [TECHNICIAN_PHONE] is not the correct name for
the control on your form.

However, a couple of comments not directly on your question... What you
are doing here would generally be regarded as an invalid process. A
database is supposed to be used relationally, part of which means that
data should not be replicated from one part of the database to another.
Whatever the record source of your form, it should only have one field
referring to the technician, corresponding to the unique identifier for
the technician. There are various approaches to getting the Phone and
Email showing up on the form, but they do *not* include writing the data
into the fields. By the way, it looks like the unique identifier
(primary key?) for the tech in the Tech table is Tech_name, am I right?
If so, you have to consider whether it will ever be possible to have
two Techs with the same name.
 

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

Similar Threads


Top