Following is the SQL for query with only the ShipTo Table being used. I
get
all fields except the Customer ID filled in.
SELECT ShipTo.ShipToID, ShipTo.ShipName, ShipTo.Address1, ShipTo.Address2,
ShipTo.City, ShipTo.State, ShipTo.Country, ShipTo.ZipCode,
ShipTo.ContactPerson, ShipTo.Title, ShipTo.Phone, ShipTo.Fax,
ShipTo.Email,
ShipTo.CustomerID
FROM ShipTo;
Here is the SQL for the query with ShipTo Table and Customer Table. When
I
use this query, I ony get a row with no information.
SELECT ShipTo.ShipToID, ShipTo.ShipName, ShipTo.Address1, ShipTo.Address2,
ShipTo.City, ShipTo.State, ShipTo.Country, ShipTo.ZipCode,
ShipTo.ContactPerson, ShipTo.Title, ShipTo.Phone, ShipTo.Fax,
ShipTo.Email,
ShipTo.CustomerID
FROM Customers INNER JOIN ShipTo ON Customers.CustomerID =
ShipTo.CustomerID;
What I am attempting to do is access the command button "Ship to
Information" to open the Ship to form and be able to enter the shipto
information for that customer and have only that customer's specific info
show up when looking at the ship to command button (after entering info)
rather than all customer shipto info.
Thanks in advance.
Ken Snell said:
Post the SQL statement of the query that you're trying to use...
--
Ken Snell
<MS ACCESS MVP>
jwrnana said:
I have done some testing and still having a problem. The Customer ID is a
numeric field. I went back to my query and found that it is not working.
What I am finding is that IF I have my Customer table and my ShipTo table
in
the same query, I get blank fields. CustomerID is the key for customer
table and ShipToId is the primary key for the Ship to table. They are
linked by CustomerID.
What do I need to look for??
Thanks
JR
Is CustomerID a numeric or text field? If it's text, delimit the value
with
' characters:
stLinkCriteria = "[CustomerID]='" & Me![CustomerID] & "'"
--
Ken Snell
<MS ACCESS MVP>
Private Sub Ship_to_Click()
On Error GoTo Err_Ship_to_Click
Dim stDocName As String
Dim stLinkCriteria As String
Following is info behind my Form that is opened with a command button.
stDocName = "ShipTo Form"
stLinkCriteria = "[CustomerID]=" & Me![CustomerID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Ship_to_Click:
Exit Sub
Err_Ship_to_Click:
MsgBox Err.Description
Resume Exit_Ship_to_Click
End Sub
Several problems exist. The information is not being saved unique
to
the
customer and the field Customer ID on the Ship to form is reading
"Name?".