Thursday, June 2, 2011

Combine Multiple Fields into One - Microsoft Access

While generating usernames from an Access database it is necessary to combine first names with middle initials with last names to create a full Windows username that has a low chance of repition (SFortin can be many people).  Do the following to achieve this:

Create a table that has your ID, FName, MName, and LName. 


Next make a query (in Design mode) that is pulled from the table you made and contains all the fields (ID, FName, MName, and LName).

Next paste the following into the next query column, first line (Field):

            UserName: [FName] & "" & [MName] & "" & [LName]


Change the type of query from “Select” to “Make Table”.  Name the table you want to make and if it is in the database your are currently working in or an external one.


Save the query and run it.  You will be warned you are about to make a new table with ## rows.  Press yes to this.

There you go!  You now have a database table of valid Windows usernames.

No comments:

Post a Comment