Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Re: one fuction on more forms -for John


Message #1 by "Nikola" <Nikola@b...> on Tue, 26 Nov 2002 00:45:08 -0000
Ok I will try tomorrow.
thanks

-----Original Message-----
From: John Ruff [mailto:papparuff@a...]
Sent: Monday, November 25, 2002 10:20 PM
To: Access
Subject: [access] Re: one fuction on more forms -Greg


They will be formatted to whichever way you have them formatted.  If you
have not formatted the dates, they will use the format as established by
the System.

John V. Ruff - The Eternal Optimist :-)
Always Looking For Contract Opportunities

www.noclassroom.com
Live software training
Right over the Internet

Home:  xxx.xxx.xxxx
Cell: 253.307/2947
9306 Farwest Dr SW
Lakewood, WA 98498

"Commit to the Lord whatever you do,
	and your plans will succeed." Proverbs 16:3



-----Original Message-----
From: Nikola [mailto:Nikola@b...] 
Sent: Monday, November 25, 2002 4:04 PM
To: Access
Subject: [access] Re: one fuction on more forms -Greg


yes !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Thanks JOHN !!!!!!!!
So on this way all my date's will be formatted in US format no mater
what is Reg Settings
(mm-dd-yy,dd/mmm/yyyy,yyyy/dd/mm,) Correct ?
I will try tomorrow because on this PC I don't have Access.

Thanks one more time

Nikola

-----Original Message-----
From: John Ruff [mailto:papparuff@a...]
Sent: Monday, November 25, 2002 9:32 PM
To: Access
Subject: [access] Re: one fuction on more forms -Greg


Nikola,

Change your query by deleting the following code in your query WHERE
clause.

AND ((Order.OrderedlDate) Between [forms]![frmFullBudget].[txtStartDate]
And
[forms]![frmFullBudget].[txtEndDate])

Now  create a criteria string in your code and use the WhereCondition
property of your DoCmd.OpenReport to select the date range for your
report. Like this:

    Dim stDocName1 As String
    Dim strCriteria as string

    stDocName1 = "Vessel Budget"
    strCriteria = "OrderedlDate>=#" & txtStartDate & "# " & _
                    "AND OrderedlDate<=#" & txtEndDate & "#"
    Select Case ReportsOption
        Case 1
            DoCmd.OpenReport stDocName1, acViewPreview,,strCriteria
        Case 2
            DoCmd.OpenReport stDocName1, acViewNormal,,strCriteria   End
Select
    end select

    Me.Visible = False


John V. Ruff - The Eternal Optimist :-)
Always Looking For Contract Opportunities

www.noclassroom.com
Live software training
Right over the Internet

Home:  xxx.xxx.xxxx
Cell: 253.307/2947
9306 Farwest Dr SW
Lakewood, WA 98498

"Commit to the Lord whatever you do,
	and your plans will succeed." Proverbs 16:3



-----Original Message-----
From: Nikola [mailto:Nikola@b...]
Sent: Monday, November 25, 2002 2:50 PM
To: Access
Subject: [access] Re: one fuction on more forms -Greg


Hi Greg,

Ok sorry for my English.I will try from beginning.Let say I have Form
with txtStartDate and txtEndDate and one Button (preview). So i enter
date in bout field (Reg. Settings are dd/mm/yyyy).On event click for
button is code:
------------- start------------
Private Sub cmbPreview_Click()
On Error GoTo Err_cmbPreview_Click


Select Case ReportsOption
Case 1
 Dim stDocName1 As String

    stDocName1 = "Vessel Budget"
    DoCmd.OpenReport stDocName1, acViewPreview
    Me.Visible = False
Case 2 .......
--------------- end ---------------
So I create Query  from Table Orders and for Field OrdersDate craiteria
is : between [forms]![frmTest].[txtStartDate] And
[forms]![frmTest].[txtEndDate] .This Query is saved Like qryOrderDate ,
and for my Report "Vessel Budget" Source is qryOrderDate. Now Question :
For Query build in VBA Code I mast format date to US format
mm/dd/yyyy.But how to insert US format function when Query is Saved in
Query Object aria? Example :

When I Open my Query in Design mode and select SQL view I have this :

SELECT Order.VesselID, Order.AccCodeID, Order.OrderNo, Order.SupplierID,
Order.Description, Order.OrderedlDate, Order.EstCostUSD,
TotInvCost.TotalInvCost,
IIf(IsNull([TotalInvCost]),[EstCostUSD],[TotalInvCost]) AS CostUSD,
IIf(IsNull([TotalInvCost]),"E") AS Leter, Order.Cancelled
FROM [Order] INNER JOIN TotInvCost ON Order.OrderID = TotInvCost.OrderID
WHERE (((Order.VesselID)=[forms]![frmFullBudget]![cmbVesselName]) AND
((Order.AccCodeID) Is Not Null) AND ((Order.OrderedlDate) Between
[forms]![frmFullBudget].[txtStartDate] And
[forms]![frmFullBudget].[txtEndDate]) AND ((Order.EstCostUSD) Is Not
Null) AND ((Order.Cancelled)=No)) ORDER BY Order.OrderNo;

How to insert US format in function in Red and bold part of code?

I hope I didn't say so many nonsense :-)

Thanks for your time.

Nikola



-----Original Message-----
From: Gregory Serrano [mailto:SerranoG@m...]
Sent: Monday, November 25, 2002 1:16 PM
To: Access
Subject: [access] Re: one fuction on more forms -Greg


Nikola,

<< I'm still confused,
How to use function in query when query is not build from Code ? >>

Now I'm confused.  I don't understand exactly what you're asking.

Greg
---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to 




---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to 


---
Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to 






  Return to Index