Automatically populate fields in my forms

M

mmatz

If I have a customers table with SSN for key field and I have an order table
with SSN for the joining field, how can I go to the order form, put in the
SSN and get the first and last name to automatically populate for me?

Thanks!
 
B

BruceM

Whatever you do, you will need to take great care to protect your data if
you are storing SSNs, as you could be in for some liability if the records
are compromised. Access is an application development tool; the actual
database that is installed with a standard Access installation is called Jet
(although I couldn't say about Access 2007). It is generally agreed that
Jet does not provide adequate security for sensitive data, even with
user-level security applied.
 
S

strive4peace

Hi mmatz,

since SSN exists in both places, there is no need to store the names in
any other location as they can always be shown. It is better NOT to
store this data twice anyway, in case changes are made.

do this:

make SSN a combobox on your order form

Name --> SSN
ControlSource --> SSN
RowSource -->
SELECT SSN
, Lastname & ", " & Firstname as Fullname
FROM Customers
ORDER by Lastname, Firstname

BoundColumn --> 1
ColumnCount --> 2
ColumnWidths --> 1;1.5
Listwidth --> 2.7 (sum of column widths + 0.2 for scrollbar)

then, make a textbox control with these properties:
Name --> Fullname
Controlsource --> = SSN.column(1)

The reason that column 1 is referenced instead of column 2 is that
column indexes start with 0, not 1, in Access.

If your fieldnames are not SSN, Lastname, Firstname or your tablename is
not Customers, then make the appropriate substitutions <smile>


Warm Regards,
Crystal

Access Basics
8-part free tutorial that covers essentials in Access
http://www.accessmvp.com/Strive4Peace/Index.htm

*
:) have an awesome day :)
*
 

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

Top