Senin, 17 Maret 2014

Re: [MS_AccessPros] Report not opening, Dialog Form is blank

 

Hi John,

On the query i have now defined Parameters as:
PARAMETERS [Forms]![Clients Claim Undelivered Cargo Per Pc Dialog]![ClientCIN] Long, [Forms]![Clients Claim Undelivered Cargo Per Pc Dialog]![ConsignmentNo] Text ( 255 );
SELECT...
===========
Reports code is:
Private Sub Report_Close()
    DoCmd.Close acForm, "Clients Claim Undelivered Cargo Per Pc Dialog"
    DoCmd.OpenForm "Clients Claim"
    DoCmd.Restore
End Sub

Private Sub Report_NoData(Cancel As Integer)
    MsgBox "This Client has no claims for the Consignment Number you entered." & vbCrLf & _
            "OR this Client CIN does not exist" & vbCrLf & _
           "Please enter correct Consignment Number for his claim" & vbCrLf & _
           "" & vbCrLf & _
           "Try again..." _
           , vbInformation, "PCTL - Information"
    Cancel = 1
End Sub

Private Sub Report_Open(Cancel As Integer)
' Set public variable to true to indicate that the report
' is in the Open event
    bInReportOpenEvent = True
' Open Clients Claim Undelivered Cargo Per Pc Dialog
    DoCmd.OpenForm "Clients Claim Undelivered Cargo Per Pc Dialog", , , , , acDialog
' Cancel Report if User clicked the Cancel Button
    If IsLoaded("Clients Claim Undelivered Cargo Per Pc Dialog") = False Then Cancel = True
' Set public variable to false to indicate that the
' Open event is completed
    bInReportOpenEvent = False
End Sub
==========
Forms code is:
Private Sub Form_Open(Cancel As Integer)
If Not bInReportOpenEvent Then
    ' If we're not called from the report
    MsgBox "For use from the 'Clients Claim Undelivered Cargo (Piece wise)' Report only", _
            vbOKOnly
    Cancel = True
  End If
Form_Open_Exit:
  Exit Sub
End Sub
===============
On Form control cboClientCIN Row Source is:
SELECT DISTINCT ClientsClaim.ClientCIN FROM ClientsClaim ORDER BY ClientsClaim.ClientCIN;

And cboConsignmentNo Row Source is:
SELECT DISTINCT ClientsClaim.ConsignmentNo FROM ClientsClaim ORDER BY ClientsClaim.ConsignmentNo;

Yet having the same problem

Khalid



On Monday, March 17, 2014 3:15 PM, John Viescas <JohnV@msn.com> wrote:
 
Khalid-

Do you have code in the Report that opens the Dialog form in the Open event?  And what code is in the form?

Also, you might need to explicitly define the parameter in the query:

PARAMETERS [Forms]![Clients Claim Undelivered Cargo Per Pc Dialog]![ClientCIN] Text;
SELECT ...

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On Mar 17, 2014, at 9:04 AM, Khalid Tanweer <khalidtanweerburrah@yahoo.com> wrote:

Hi All,
I have some reports which i am opening through Dialog Form, which are working right.

But now i am stucked for many reports for which report is not opening and Dialog Form to fill parameters comes to a blank form, further i am unable to close this form unless i right click on the form and click on "Form Design".

I have further noticed that any query which have 'Sum' or 'Count' they are not working.

For example i put down the query:

SELECT ClientsClaimPerPiece.ClientCIN, ClientsClaimPerPiece.ClientName, ClientsClaimPerPiece.ConsignmentNo, ClientsClaimPerPiece.CartonNo, ClientsClaimPerPiece.Product, ClientsClaimPerPiece.ProductQtyClaimed, ClientsClaimPerPiece.PricePerPc, ClientsClaimPerPiece.ClaimPerPc, Sum(ClientsClaimPerPiece.ProductQtyClaimed) AS TotQtyClaimed
FROM ClientsClaimPerPiece
GROUP BY ClientsClaimPerPiece.ClientCIN, ClientsClaimPerPiece.ClientName, ClientsClaimPerPiece.ConsignmentNo, ClientsClaimPerPiece.CartonNo, ClientsClaimPerPiece.Product, ClientsClaimPerPiece.ProductQtyClaimed, ClientsClaimPerPiece.PricePerPc, ClientsClaimPerPiece.ClaimPerPc
HAVING (((ClientsClaimPerPiece.ClientCIN)=[Forms]![Clients Claim Undelivered Cargo Per Pc Dialog]![ClientCIN]) AND ((ClientsClaimPerPiece.ClientName) Is Not Null) AND ((ClientsClaimPerPiece.ConsignmentNo)=[Forms]![Clients Claim Undelivered Cargo Per Pc Dialog]![ConsignmentNo]) AND ((ClientsClaimPerPiece.CartonNo) Is Not Null) AND ((ClientsClaimPerPiece.Product) Is Not Null) AND ((ClientsClaimPerPiece.ProductQtyClaimed) Is Not Null) AND ((ClientsClaimPerPiece.PricePerPc) Is Not Null) AND ((ClientsClaimPerPiece.ClaimPerPc) Is Not Null))
ORDER BY ClientsClaimPerPiece.CartonNo, ClientsClaimPerPiece.Product;
============
Could somebody help. Is there some other method to open Dialog Forms for such queries OR something is wrong in this query.
============
The report works perfectly if i do not use Dialog Form and simply in the query i put criteria
Like [Enter Client CIN]
Like [Enter Consignment No]

Thanks in advance for assistance.

Khalid




__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)
.

__,_._,___

Tidak ada komentar:

Posting Komentar