Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / April 2008

Tip: Looking for answers? Try searching our database.

Main form won't print

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ron Weaver - 09 Apr 2008 00:37 GMT
I have a form with a subform. The main form has names and dates and the
subform has products. The only way the order will print is if the subform has
an entry in it. I would like to be able to print just the customer info at
times. I have tried putting code in the print command buttons On Click event
(DoCmd.RunCommand acCmdSaveRecord) along with the other print code. Can
someone give me an idea why this is happening?
Dirk Goldgar - 09 Apr 2008 00:50 GMT
>I have a form with a subform. The main form has names and dates and the
> subform has products. The only way the order will print is if the subform
[quoted text clipped - 4 lines]
> (DoCmd.RunCommand acCmdSaveRecord) along with the other print code. Can
> someone give me an idea why this is happening?

Are you running a report to print the data?  If so, my guess would be that
the report's recordsource is a query that does an inner join of the main
form's recordsource table with the subform's recordsource table.  Such a
query would only return a record when there are matching main-form and
subform records.  The solution is to change the query to an outer join,
returning all the records from the main form's source table and only the
matching ones from the subform's source table.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Ron Weaver - 09 Apr 2008 01:08 GMT
You are correct about the report. When I tried to make the change, I got a
"Join Expression not Supported", and "Ambiguous Outter Join" message??

> >I have a form with a subform. The main form has names and dates and the
> > subform has products. The only way the order will print is if the subform
[quoted text clipped - 12 lines]
> returning all the records from the main form's source table and only the
> matching ones from the subform's source table.
Dirk Goldgar - 09 Apr 2008 05:49 GMT
> You are correct about the report. When I tried to make the change, I got a
> "Join Expression not Supported", and "Ambiguous Outter Join" message??

It can get tricky if you're joining more thanjust one table.  If you'll post
the original SQL of the report's recordsource,  maybe we can suggest a
version that will work.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Ron Weaver - 09 Apr 2008 14:25 GMT
Here it is:
SELECT Customer.CustomerID, Customer.FirstName, Customer.LastName,
Customer.Phone, Orders.OrderID, Orders.Room, Orders.TodaysDate,
Orders.StartDate, Orders.EndDate, Orders.ArriveTime, Orders.StartTime,
Orders.EndTime, Orders.Notes, Products.ProductID, Products.ProductName,
Orders.RoomID, [Order Details].Quanity, [Order Details].Days
FROM (Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID)
INNER JOIN (Products INNER JOIN [Order Details] ON Products.ProductID =
[Order Details].ProductID) ON Orders.OrderID = [Order Details].OrderID;
Thanks

> > You are correct about the report. When I tried to make the change, I got a
> > "Join Expression not Supported", and "Ambiguous Outter Join" message??
>
> It can get tricky if you're joining more thanjust one table.  If you'll post
> the original SQL of the report's recordsource,  maybe we can suggest a
> version that will work.
Ron Weaver - 09 Apr 2008 15:31 GMT
I tried an additional  Join. The form is working now. This is my SQL.
SELECT Customer.CustomerID, Customer.FirstName, Customer.LastName,
Customer.Phone, Orders.OrderID, Orders.Room, Orders.TodaysDate,
Orders.StartDate, Orders.EndDate, Orders.ArriveTime, Orders.StartTime,
Orders.EndTime, Orders.Notes, Products.ProductID, Products.ProductName,
Orders.RoomID, [Order Details].Quanity, [Order Details].Days
FROM (Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID)
LEFT JOIN (Products RIGHT JOIN [Order Details] ON Products.ProductID = [Order
Details].ProductID) ON Orders.OrderID = [Order Details].OrderID;
Thanks for pointing me in the right direction.

> Here it is:
> SELECT Customer.CustomerID, Customer.FirstName, Customer.LastName,
[quoted text clipped - 13 lines]
> > the original SQL of the report's recordsource,  maybe we can suggest a
> > version that will work.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.