Information to appear after updating control

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

Guest

In my form I have a query (qryCashRcpt) which is the combination of two
tables (tblEmployees and tblCashRcpt) In tblCashRcpt, there are two fields
ColCode andColCode2. In tblEmployees, there is a field tblEmp, which is the
employee number and also is the same number in colcode!tblCashRcpt. This is
a one-to-many relationship between the two tables.

In my table, I'm using the ColCode andColCode2 controls to enter
information, When I enter the number in ColCode, I would like the last name,
first name to appear so that the operator can ensure they are using the
correct code. I'm confused how to go about this. Do I need to add a column
to qryCashRcpt that matches the name to the code, or can I just program a
unbound label. Would I program on the ColCode AfterUpdate?

I know I'm not making much sense, however, I'm not a programmer and this
thought process is starting to hurt!
 
margaret said:
In my form I have a query (qryCashRcpt) which is the combination of two
tables (tblEmployees and tblCashRcpt) In tblCashRcpt, there are two
fields
ColCode andColCode2. In tblEmployees, there is a field tblEmp, which is
the
employee number and also is the same number in colcode!tblCashRcpt. This
is
a one-to-many relationship between the two tables.

In my table, I'm using the ColCode andColCode2 controls to enter
information, When I enter the number in ColCode, I would like the last
name,
first name to appear so that the operator can ensure they are using the
correct code. I'm confused how to go about this. Do I need to add a
column
to qryCashRcpt that matches the name to the code, or can I just program a
unbound label. Would I program on the ColCode AfterUpdate?

I know I'm not making much sense, however, I'm not a programmer and this
thought process is starting to hurt!

Add an unbound textbox control to your form, and in the AfterUpdate event
for the ColCode control use DLookUp to fetch the name:

Me.txtNameControl = Nz(DLookUp("[Last Name] & ',' & [First
Name]","[tblEmployees]","[tblEmp]=" & Me.ColCode),"")

Carl Rapson
 
Thanks for your response. I had posted this also in the query section and
got a response. I actually altered my query to show tblemployees and
tblemployees_1 and then pointed collcode to tblemployees and collcode2 to
tblemployees_1 and that worked.

Thanks again for your response.

Carl Rapson said:
margaret said:
In my form I have a query (qryCashRcpt) which is the combination of two
tables (tblEmployees and tblCashRcpt) In tblCashRcpt, there are two
fields
ColCode andColCode2. In tblEmployees, there is a field tblEmp, which is
the
employee number and also is the same number in colcode!tblCashRcpt. This
is
a one-to-many relationship between the two tables.

In my table, I'm using the ColCode andColCode2 controls to enter
information, When I enter the number in ColCode, I would like the last
name,
first name to appear so that the operator can ensure they are using the
correct code. I'm confused how to go about this. Do I need to add a
column
to qryCashRcpt that matches the name to the code, or can I just program a
unbound label. Would I program on the ColCode AfterUpdate?

I know I'm not making much sense, however, I'm not a programmer and this
thought process is starting to hurt!

Add an unbound textbox control to your form, and in the AfterUpdate event
for the ColCode control use DLookUp to fetch the name:

Me.txtNameControl = Nz(DLookUp("[Last Name] & ',' & [First
Name]","[tblEmployees]","[tblEmp]=" & Me.ColCode),"")

Carl Rapson
 

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

Back
Top