Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can 2 columns in a view be combined in a @Unique 1

Status
Not open for further replies.

Righty

IS-IT--Management
May 24, 2001
162
US
I am creating a form to pull information from a view. The first column is a Last Name of person and the second column is "First Name" of person. In the form is there a formula to combine these columns so the user can pull the full name of the particular person in one drop down list?
 
Probably the easiest way to do this is to create a lookup view (you could make it a hidden view) that has one column with the formula firstname +" "+ lastname. This column would then display the full mane of the person.

In the form you would use @DBColumn to populate the listbox with the names from the view as follows.

@DbColumn( class : "NoCache" ; server : database ; view ; columnNumber ).

This formula will return all the information in the specified column.

I always use the replica ID in the server and database positions in this formula so if the user is working on a local replica it will check this replica first instead of giving "cannot find path to server" if the server name and database are hard coded into the formula.

I find lookup views very handy in my databases as it make the form perform a little better if it is not making addidtional calculations like doing one lookup for the firstname and then looking up the lastname and then adding them together.

Hope this helps!
 
By the way..... if you don't want and names repeated in the list you would need to use @Unique around the @DBColumn formula. ie

@Unique(@DbColumn( class : "NoCache" ; server : database ; view ; columnNumber ))

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top