Getting data onto forms.

G

Guest

Ok, here’s the problem. I have five tables, tblCustomers, tblInvoiceAddress,
tblDeliveryAddress, tblOrders and tblCategories. The relationship between
tblCustomers and tblInvoiceAddress is a One to Many because the customer
might have several different invoice addresses. The relationship between the
tblInvoiceAddress and tblDeliveryAddress is also a One to Many because the
customer might want deliveries made to several different addresses.
tblCustomers to tblOrders is a One to Many as is tblOrders to tblCategories.
Now the problem being that, I need all this information on one form.
Is there a way I can do it without using Subforms or linked forms for
tblInvoiceAddress, tblDeliveryAddress and tblOrders? tblCategories can be on
a Subform.
I then need to put the relevant information into a report so that I can
print off an invoice.
 
A

Arvin Meyer

No need to repeat any information other than the Key on the form or invoice.
From the Key you can look up and fill text boxes by refering to the other
columns on the combo box used to hold the key. Let's assume that you have a
combo box for CustomerID. It's RowSource might be something like (air code):

SELECT tblInvoiceAddress.CustomerID, tblCustomers.CustomerName,
tblInvoiceAddress.Address, tblInvoiceAddress.City, tblInvoiceAddress.State,
tblInvoiceAddress.Zip
FROM tblInvoiceAddress INNER JOIN Table1 ON tblCustomers.CustomerID =
tblInvoiceAddress.CustomerID;

Notice that there are 6 column indexed 0 to 5. So after I selected the
CustomerID from the tblInvoiceAddress table using the correct address
record, I can use the AfterUpdate event like this:

Private Sub MyCombo_AfterUpdate()

Me.txtAddress = Me.MyCombo.Column(2)
Me.txtCity = Me.MyCombo.Column(3)
Me.txtState = Me.MyCombo.Column(4)
Me.txtZip = Me.MyCombo.Column(5)

End Sub
---
HTH
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
G

Guest

Arvin,

I have a similar problem with my school database. But I like to explain it
over the phone. Can you please email me a phone with a desired time @
(e-mail address removed). Thank you so much.
 
D

Dirk Goldgar

John said:
Arvin,

I have a similar problem with my school database. But I like to
explain it over the phone. Can you please email me a phone with a
desired time @ (e-mail address removed). Thank you so much.

I guess you're prepared to pay Arvin's consulting fee?
 

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