How do I retrieve data from a database just by entering their SSN

K

KiarBST

I am trying to create a form that can retrieve Name, Rate, Rank,
CreditCardNumber, CreditCardExpireDate information according to the
SocialSecurityNumber I entered. That information will automatically be
entered onto the Airline/Hotel/Car Rental worksheet form so I can retrieve
information to calculate end of quarter spendings for our travel budget
Somone recommended a PivotTable, but I'm not sure how PivotTable can create a
table for individual reports.
 
A

Allan Murphy

Do you want the Social Security Number information to populate your
Airline/Hotel/Car Rental?

I assume that you have a table that stores SocialSecurityNumber, Name, Rate,
Rank, CreditCardNumber, CreditCardExpireDate

You could use Dlookup for each field but this involve a bit of coding for
each variable.

Alternatively, on your Airline/Hotel/Car Rental worksheet form you could
have a field for Social Security Number and use a combo to list all the
Social Security Number . Your combo box will have columns for
SocialSecurityNumber, Name, Rate, Rank, CreditCardNumber,
CreditCardExpireDate but only have the SocialSecurityNumber column visible
in the drop down.

Using this option you have the following code in the afterupdate event of
the combo box

soc_sec_num is the name of your combo box.

private sub soc_sec_num_afterupdate
me!name = soc_sec_num.column(1)
me!rate = soc_sec_num.column(2)
me!rank = soc_sec_num.column(3)
me!CreditCardNumber = soc_sec_num.column(4)
me!CreditCardExpireDate = soc_sec_num.column(5)
end sub

You will note that you have six items in your query, the column count from
0, in this case Social Security Number is column(0)
 
Top