Concatenation

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

Guest

I placed a concatenation in a query (Name(s): [tblwodLeadTechnician] &"/"&
[tblwodAssistant] &"/"& [tblwod2ndAssistant]) so that the last name of the
employees are viewed in a single cell, but I have two problems:

1.) How do I right the equation so that the "/" are not visible if there is
not an Assistant or 2nd Assistant?
also,
2.) I have a combo box in the form where I can select an employee's last
name. However, the value that is returned in the report is the Primary Key
value, ie; "001" instead of "Smith".

I know that using a control wizard while building the report would help, but
for some reason the wizard is not currently enabled (and, yes, the "control
wizard" buttton in the toolbox is depressed).
Thanks
 
No idea about question 2, but for question 1, you can check whether the subsequent name fields are null before appending them:

iif ([tblwod2ndAssistant] Is Null, iif ([tblwodAssistant] Is Null, [tblwodLeadTechnician], [tblwodLeadTechnician] & "/" & [tblwodAssistant]), [tblwodLeadTechnician] & "/" & [tblwodAssistant]) & "/" & [tblwod2ndAssistant])

This is assuming that someone can't have a 2nd Assistant if they don't have an Assistant. If that isn't true, the query gets quite a bit more complicated...
 
Thanks, David. I do believe this is exactly what I was looking for. Thank
you for your time...and sharing your knowledge!
 
In the AfterUpdate event of cboFindName put a docmd.gotorecord. with a where
clause to the effect that the record's Primary Key value will equal the
value of cboFindName.

HTH
 

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