I always prefer using Queries as the basis of combo boxes, since you can
control the order of the records.
Create a query on table 1 that lists all of the fields of the table in which
you're interested. Make sure it returns what you want, sorted in the correct
order. For the sake of argument, let's assume that the 1st field is the Id,
the 2nd is the Address, the 3rd is the name and the 4th is the telephone
number. (I'm assuming table 2 has a field that points to the Id of the
record in table 1)
Now, open your form in Design mode. Select the combo box (which I'm going to
assume is named cboProperties) and look at its properties. Presumably its
Row Source Type property is set to Table/Query. Change the Row Source
property to the name of the query you just saved above. Still looking at the
properties of the combo box, set the Column Count property to what ever is
correct (4 in my example above), set the Column Widths property to 0;2;0;0
(I'm assuming you're using inches: if not, you may have to play with that
value of 2 until it's a reasonable width.)
Now, find After Update event property associated with your combo box. Select
[Event Procedure] for its property, and click on the ellipsis (...) to the
right of the field. That will take you into the VB Editor.
Assuming you have a field named txtName, and one named txtTelephone on your
form, add the following code:
Private Sub cboProperties_AfterUpdate
Me.txtName = Me.cboProperties.Column(2)
Me.txtTelephone = Me.cboProperties.Column(3)
End Sub
Hope this helps.
--
Doug Steele, Microsoft Access MVP
(No private e-mails, please)
Carey G said:
Thanks for your imput!!!!!!!!! But I'm to thick to completely understand your response
So to better explain (for me probably than for you!)
Table one (listings) holds all the information about a property, address,
names, telephone numbers, etc and a form to input the information to that
table.
Table 2 (offers) stores information about offers and has it's own form. In
the offers table & form, a lot of the information is the same as the
information in the listings table. The offers form is set up with a drop
down (combo) box for the address of properties we have listed and gets the
drop down information from the field / column in the listings table. NO
Queries!
Upon selection of a property address in the offers form...I want the
remaining offer form to autofill from fields in the listings table. ie:
names, telephone numbers, etc.
Since there is no query, where would I input the example you gave me?
And how would that develop the relationship to other text boxes/fields in the form?
I kind of understand the track you were on (after event) but the query
thing and dropping the fields in the query confused me???? and I don't
understand how that creates the tie to the other fields/text boxes within
the form??