Two table in one form

  • Thread starter Printing only filtered data in a form
  • Start date
P

Printing only filtered data in a form

OK- I have two tables- one for shipping addresses which will always have only
4 records and the other form includes vendor addresses. The vendor addresses
table is always growing.
Here are the fields in the ship/vendor table Company, Address, City State
ZIP and phone.
I created a Purchase order form that includes other items but what I want is
to create are two combo boxes with a lookup field. So when I choose an item
from the Vendor Company Combo Box it auto populates the remanider of the
record in their corresponding fields.
In the same form I want the Ship combo box to do the same.

Any help will be grateful!
Chel
 
L

Linq Adams via AccessMonster.com

Set up your combobx using the wizard and include the fields you need, i.e.
Company, Address, City, State, etc. If the fields are added to the combobox
in that order, then the syntax would be

Private Sub YourComboBox_AfterUpdate()
Me.Company= Me.YourComboBox.Column(0)
Me.Address = Me.YourComboBox.Column(1)
Me.City = Me.YourComboBox.Column(2)
Me.Address = Me.YourComboBox.Column(3)
End Sub

Notice that the column index is zero based.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
L

Linq Adams via AccessMonster.com

Sorry, that last line of code should be

Me.State = Me.YourComboBox.Column(3)


not

Me.Address = Me.YourComboBox.Column(3)


Linq said:
Set up your combobx using the wizard and include the fields you need, i.e.
Company, Address, City, State, etc. If the fields are added to the combobox
in that order, then the syntax would be

Private Sub YourComboBox_AfterUpdate()
Me.Company= Me.YourComboBox.Column(0)
Me.Address = Me.YourComboBox.Column(1)
Me.City = Me.YourComboBox.Column(2)
Me.Address = Me.YourComboBox.Column(3)
End Sub

Notice that the column index is zero based.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
P

Printing only filtered data in a form

Thanks!

Linq Adams via AccessMonster.com said:
Sorry, that last line of code should be

Me.State = Me.YourComboBox.Column(3)


not

Me.Address = Me.YourComboBox.Column(3)




--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 

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