Autofill/Option to Enter Multiple Fields

B

BethR

Hello.

I am creating a mailing request database. User has to fill in who the
shipment is going to. I have an address list already in the DB and would like
the user to have the option of choosing a recipient from the address list or
entering the recipient's information into the form. If the recipient already
exists on the address list, how to I get the form to autofill with that
recipient's current mailing address already in the DB? I am currently using a
Lookup on the table to locate the recipient's name in the list.

Thanks!
 
D

Damon Heron

First make the record source of a form the table that has the recipient info
(ID, Name, Address, City, State, etc)
Then put your text boxes on the form for Address, City, St, etc. on the form
with the appropriate sources.
Add a Combobox with the source a query, like this (this is from a table
called tblCustomers):
SELECT tblCustomers.ID, tblCustomers.Name
FROM tblCustomers;
Set the column count to 2, width 0";1"
In the afterupdate event of the combobox, put:
Private Sub Combo1_AfterUpdate() 'use your combobox name!
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo1], 0)) 'use your ID field
name!
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

When user selects the name from the combobox, the fields fill in when the
form goes to that record. If you are having a label or something printed,
you will need a command button on the form to print it.

Damon
 

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