Set date range and filter results via form/menu for Report Preview

I created a form to use as a "print menu" for a report. You can select
the date range (txtStartDate and txtStopDate). I have this part of the
code working. However, I also need to be able to filter based on the
job flag: [Flag] with value of 1, 2 or 3-- OR show all (still applying
the date range). I created a list box on the form and named it
[ReportFilter]. It's bound to the first column (hidden) with 0 for
All, 1, 2 and 3 to correspond with the Flag names. I can't figure out
how to get All records to show on top of not being able to incorporate
with the above date range.

Here's what I have so far. How would I modify?

Private Sub btnViewRpt_Click()
    Dim strReport As String
    Dim strField As String
    Dim strWhere As String
    Const conDateFormat = "\#mm\/dd\/yyyy\#"

    strReport = "rptJobsbyCustInclCanc_All"
    strField = "Callin"

    If IsNull(Me.txtStartDate) Then
        If Not IsNull(Me.txtEndDate) Then
            strWhere = strField & " <= " & Format(Me.txtEndDate,
conDateFormat)
        End If
    Else
        If IsNull(Me.txtEndDate) Then
            strWhere = strField & " >= " & Format(Me.txtStartDate,
conDateFormat)
        Else
            strWhere = strField & " Between " &
Format(Me.txtStartDate, conDateFormat) _
                & " And " & Format(Me.txtEndDate, conDateFormat)
        End If
    End If

    ' Debug.Print strWhere
    DoCmd.OpenReport strReport, acViewPreview, , strWhere

End Sub


Any help anyone can offer will be greatly appreciated!

Thanks,
Ruth

0
Ruth
4/25/2007 9:33:46 PM
access 16762 articles. 3 followers. Follow

12 Replies
820 Views

Similar Articles

[PageSpeed] 37

Ruth wrote:
> I created a form to use as a "print menu" for a report. You can select
> the date range (txtStartDate and txtStopDate). I have this part of the
> code working. However, I also need to be able to filter based on the
> job flag: [Flag] with value of 1, 2 or 3-- OR show all (still applying
> the date range). I created a list box on the form and named it
> [ReportFilter]. It's bound to the first column (hidden) with 0 for
> All, 1, 2 and 3 to correspond with the Flag names. I can't figure out
> how to get All records to show on top of not being able to incorporate
> with the above date range.
> 
> Here's what I have so far. How would I modify?
> 
> Private Sub btnViewRpt_Click()
>     Dim strReport As String
>     Dim strField As String
>     Dim strWhere As String
>     Const conDateFormat = "\#mm\/dd\/yyyy\#"
> 
>     strReport = "rptJobsbyCustInclCanc_All"
>     strField = "Callin"
> 
>     If IsNull(Me.txtStartDate) Then
>         If Not IsNull(Me.txtEndDate) Then
>             strWhere = strField & " <= " & Format(Me.txtEndDate,
> conDateFormat)
>         End If
>     Else
>         If IsNull(Me.txtEndDate) Then
>             strWhere = strField & " >= " & Format(Me.txtStartDate,
> conDateFormat)
>         Else
>             strWhere = strField & " Between " &
> Format(Me.txtStartDate, conDateFormat) _
>                 & " And " & Format(Me.txtEndDate, conDateFormat)
>         End If
>     End If
> 
>     ' Debug.Print strWhere
>     DoCmd.OpenReport strReport, acViewPreview, , strWhere
> 
> End Sub
> 
> 
> Any help anyone can offer will be greatly appreciated!
> 
> Thanks,
> Ruth

Try this modified version (watch for line wrapping):

Private Sub btnViewRpt_Click()
Dim strReport As String
Dim strField As String
Dim strWhere As String
Const conDateFormat = "\#mm\/dd\/yyyy\#"

strReport = "rptJobsbyCustInclCanc_All"
strField = "Callin"

strWhere = ""
If IsNull(Me.txtStartDate) Then
   If Not IsNull(Me.txtEndDate) Then
     strWhere = strField & " <= " & Format(Me.txtEndDate, conDateFormat)
   End If
Else
   If IsNull(Me.txtEndDate) Then
     strWhere = strField & " >= " & Format(Me.txtStartDate, conDateFormat)
   Else
     strWhere = strField & " Between " & Format(Me.txtStartDate, 
conDateFormat) _
     & " And " & Format(Me.txtEndDate, conDateFormat)
   End If
End If
If Not IsNull(Me!ReportFilter.Value) Then
   If Me!ReportFilter.Value <> 0 Then
     If strWhere <> "" Then
       strWhere = "(" & strWhere & ") AND [Flag] = " & Chr(34) & 
CStr(Me!ReportFilter.Value) & Chr(34)
     Else
       strWhere = "[Flag] = " & Chr(34) & CStr(Me!ReportFilter.Value) & 
Chr(34)
     End If
   End If
End If
' Debug.Print strWhere
If strWhere <> "" Then
   DoCmd.OpenReport strReport, acViewPreview, , strWhere
Else
   DoCmd.OpenReport strReport, acViewPreview
End If
End Sub

James A. Fortune
MPAPoster@FortuneJames.com
0
James
4/26/2007 2:33:37 AM
Thanks, James. I appreciate your help!

Adding the code, I was able to get it to run by adding another End If
right before End Sub (per debugger). I can get the report for "All"
but making any of the other selections gives this error:

Run-time error '3464':

Data type mismatch in criteria expression.

Suggestions?

Thanks ever so much for your help!

Ruth

0
Ruth
4/26/2007 2:20:24 PM
Ruth wrote:
> Thanks, James. I appreciate your help!
> 
> Adding the code, I was able to get it to run by adding another End If
> right before End Sub (per debugger).

I don't see where I missed any.

>                           I can get the report for "All"
> but making any of the other selections gives this error:
> 
> Run-time error '3464':
> 
> Data type mismatch in criteria expression.
> 
> Suggestions?
> 
> Thanks ever so much for your help!
> 
> Ruth
> 

If [Flag] is a numeric field then don't use the Chr(34) values.  Compare 
it directly to the number.  E.g.,

     strWhere = "[Flag] = " & CStr(Me!ReportFilter.Value)

I hope that helps.  If not, post the code you are now running along with 
the field types.

James A. Fortune
MPAPoster@FortuneJames.com
0
James
4/27/2007 12:09:07 AM
On the missing EndIf, it was my fault! I either missed it in copying
or deleted it. I was going to post back when I realized it, but my
response hadn't posted to the forum yet. So-- you're right! You didn't
miss any.

I'm trying your suggestion now. I'll post back and let you know the
result. Thanks again for your help!

0
Ruth
4/27/2007 2:51:04 PM
Hi James,
It works beautifully!  ... for three of my choices... *sigh*

The [Flag] field is numeric (contents of the field are 1, 2, 3 or
null). I can get the appropriate report back if the choice is a 1, 2
or 3, but now I can't get the "All" report that delivered everything
in the date range if Me!ReportFilter.Value was left blank.

Here's the current code:

Private Sub Command0_Click()
Dim strReport As String
Dim strField As String
Dim strWhere As String
Const conDateFormat = "\#mm\/dd\/yyyy\#"



strReport = "rptJobDetailSumm-ALL"
strField = "Callin"

strWhere = "[Flag] = " & CStr(Me!ReportFilter.Value)
If IsNull(Me.txtStartDate) Then
   If Not IsNull(Me.txtEndDate) Then
     strWhere = strField & " <= " & Format(Me.txtEndDate,
conDateFormat)
   End If
Else
   If IsNull(Me.txtEndDate) Then
     strWhere = strField & " >= " & Format(Me.txtStartDate,
conDateFormat)
   Else
     strWhere = strField & " Between " & Format(Me.txtStartDate,
conDateFormat) _
     & " And " & Format(Me.txtEndDate, conDateFormat)
   End If
End If
If Not IsNull(Me!ReportFilter.Value) Then
   If Me!ReportFilter.Value <> 0 Then
     If strWhere <> "" Then
       strWhere = "(" & strWhere & ") AND [Flag] = " & CStr(Me!
ReportFilter.Value)
     Else
       strWhere = "[Flag] = " & CStr(Me!ReportFilter.Value)
     End If
   End If
End If
' Debug.Print strWhere
If strWhere <> "" Then
   DoCmd.OpenReport strReport, acViewPreview, , strWhere
Else
   DoCmd.OpenReport strReport, acViewPreview
End If
End Sub


Thanks so very, very much!!!
Ruth


0
Ruth
4/27/2007 5:38:43 PM
Ruth wrote:
> Hi James,
> It works beautifully!  ... for three of my choices... *sigh*
> 
> The [Flag] field is numeric (contents of the field are 1, 2, 3 or
> null). I can get the appropriate report back if the choice is a 1, 2
> or 3, but now I can't get the "All" report that delivered everything
> in the date range if Me!ReportFilter.Value was left blank.
> 
> Here's the current code:
> 
> Private Sub Command0_Click()
> Dim strReport As String
> Dim strField As String
> Dim strWhere As String
> Const conDateFormat = "\#mm\/dd\/yyyy\#"
> 
> 
> 
> strReport = "rptJobDetailSumm-ALL"
> strField = "Callin"
> 
> strWhere = "[Flag] = " & CStr(Me!ReportFilter.Value)
> If IsNull(Me.txtStartDate) Then
>    If Not IsNull(Me.txtEndDate) Then
>      strWhere = strField & " <= " & Format(Me.txtEndDate,
> conDateFormat)
>    End If
> Else
>    If IsNull(Me.txtEndDate) Then
>      strWhere = strField & " >= " & Format(Me.txtStartDate,
> conDateFormat)
>    Else
>      strWhere = strField & " Between " & Format(Me.txtStartDate,
> conDateFormat) _
>      & " And " & Format(Me.txtEndDate, conDateFormat)
>    End If
> End If
> If Not IsNull(Me!ReportFilter.Value) Then
>    If Me!ReportFilter.Value <> 0 Then
>      If strWhere <> "" Then
>        strWhere = "(" & strWhere & ") AND [Flag] = " & CStr(Me!
> ReportFilter.Value)
>      Else
>        strWhere = "[Flag] = " & CStr(Me!ReportFilter.Value)
>      End If
>    End If
> End If
> ' Debug.Print strWhere
> If strWhere <> "" Then
>    DoCmd.OpenReport strReport, acViewPreview, , strWhere
> Else
>    DoCmd.OpenReport strReport, acViewPreview
> End If
> End Sub
> 
> 
> Thanks so very, very much!!!
> Ruth

I see that you made some changes to what I suggested.  Plus, originally 
you used 0 instead of Null for the 'All' case.  What you want to have 
happen is for there to be no restrictions whatever on [Flag] when the 
'All' case is chosen.  The Null case in the code I suggested was simply 
to handle someone forgetting to choose a [Flag].  Anyway, make sure that 
a [Flag] criterion doesn't become a part of strWhere at all for the 
'All' case.  Perhaps use your debug line to view what you are getting 
for strWhere.

James A. Fortune
MPAPoster@FortuneJames.com
0
James
4/27/2007 10:02:42 PM
James, I apologize for the changes I made. They were inadvertant.
However, here's the completed code and it works perfectly!  Thanks
again so much for your help. If you're up for it, I have one more
variable I'd like to incorporate. I don't want to tread on your
goodwill, so please let me know if I can post a further question.

Thanks again!

Private Sub btnViewRpt_Click()
Dim strReport As String
Dim strField As String
Dim strWhere As String
Const conDateFormat = "\#mm\/dd\/yyyy\#"



strReport = "rptJobsbyCustInclCanc"
strField = "Callin"

strWhere = "[Flag] = " & CStr(Me!ReportFilter.Value)
If IsNull(Me.txtStartDate) Then
   If Not IsNull(Me.txtEndDate) Then
     strWhere = strField & " <= " & Format(Me.txtEndDate,
conDateFormat)
   End If
Else
   If IsNull(Me.txtEndDate) Then
     strWhere = strField & " >= " & Format(Me.txtStartDate,
conDateFormat)
   Else
     strWhere = strField & " Between " & Format(Me.txtStartDate,
conDateFormat) _
     & " And " & Format(Me.txtEndDate, conDateFormat)
   End If
End If
If Not IsNull(Me!ReportFilter.Value) Then
   If Me!ReportFilter.Value <> 0 Then
     If strWhere <> "" Then
       strWhere = "(" & strWhere & ") AND [Flag] = " & CStr(Me!
ReportFilter.Value)
     Else
       strWhere = "[Flag] = " & CStr(Me!ReportFilter.Value)
     End If
   End If
End If
' Debug.Print strWhere
If strWhere <> "" Then
   DoCmd.OpenReport strReport, acViewPreview, , strWhere
Else
   DoCmd.OpenReport strReport, acViewPreview

End If

End Sub


0
Ruth
4/30/2007 7:02:47 PM
Ruth wrote:
> James, I apologize for the changes I made. They were inadvertant.
> However, here's the completed code and it works perfectly!  Thanks
> again so much for your help. If you're up for it, I have one more
> variable I'd like to incorporate. I don't want to tread on your
> goodwill, so please let me know if I can post a further question.
> 
> Thanks again!
> 
> Private Sub btnViewRpt_Click()
> Dim strReport As String
> Dim strField As String
> Dim strWhere As String
> Const conDateFormat = "\#mm\/dd\/yyyy\#"
> 
> 
> 
> strReport = "rptJobsbyCustInclCanc"
> strField = "Callin"
> 
> strWhere = "[Flag] = " & CStr(Me!ReportFilter.Value)
> If IsNull(Me.txtStartDate) Then
>    If Not IsNull(Me.txtEndDate) Then
>      strWhere = strField & " <= " & Format(Me.txtEndDate,
> conDateFormat)
>    End If
> Else
>    If IsNull(Me.txtEndDate) Then
>      strWhere = strField & " >= " & Format(Me.txtStartDate,
> conDateFormat)
>    Else
>      strWhere = strField & " Between " & Format(Me.txtStartDate,
> conDateFormat) _
>      & " And " & Format(Me.txtEndDate, conDateFormat)
>    End If
> End If
> If Not IsNull(Me!ReportFilter.Value) Then
>    If Me!ReportFilter.Value <> 0 Then
>      If strWhere <> "" Then
>        strWhere = "(" & strWhere & ") AND [Flag] = " & CStr(Me!
> ReportFilter.Value)
>      Else
>        strWhere = "[Flag] = " & CStr(Me!ReportFilter.Value)
>      End If
>    End If
> End If
> ' Debug.Print strWhere
> If strWhere <> "" Then
>    DoCmd.OpenReport strReport, acViewPreview, , strWhere
> Else
>    DoCmd.OpenReport strReport, acViewPreview
> 
> End If
> 
> End Sub

O.K., I think I understand the changes you made enough to add another 
variable to the mix.

But change the first strWhere to:

strWhere = "[Flag] = " & CStr(Nz(Me!ReportFilter.Value, 0))

so that you don't get an error if the user forgets to make a choice.

James A. Fortune
MPAPoster@FortuneJames.com
0
James
4/30/2007 11:22:31 PM
I'm sorry for being confusing! I actually have 4 menus for different
reports and I'm using the same code to drive all of them. Which was
going to take me to my next "variable" question... whether I could
populate "strReport" with a value from the menu. I think I probably
can....

But instead of doing that, I'd like to add two more combo boxes as
variables.  cboCustomer and cboAircraftType. I've gotten close (I
think) but my syntax is still off. Both are text fields. They are on
the form below the ReportFilter field.

Re: your edit below, thank you! I had changed out the string when I
was making the Chr(34) change and didn't notice until it was too late!
Thanks again for catching that.
|   |  |   |
v  v  v  v
>
> But change the first strWhere to:
>
> strWhere = "[Flag] = " & CStr(Nz(Me!ReportFilter.Value, 0))
>
> so that you don't get an error if the user forgets to make a choice.
>

***********************************************************************

Thanks again for your help!

Ruth

0
Ruth
5/1/2007 7:14:54 PM
Ruth wrote:
> I'm sorry for being confusing! I actually have 4 menus for different
> reports and I'm using the same code to drive all of them. Which was
> going to take me to my next "variable" question... whether I could
> populate "strReport" with a value from the menu. I think I probably
> can....
> 
> But instead of doing that, I'd like to add two more combo boxes as
> variables.  cboCustomer and cboAircraftType. I've gotten close (I
> think) but my syntax is still off. Both are text fields. They are on
> the form below the ReportFilter field.
> 
> Re: your edit below, thank you! I had changed out the string when I
> was making the Chr(34) change and didn't notice until it was too late!
> Thanks again for catching that.
> |   |  |   |
> v  v  v  v
> 
>>But change the first strWhere to:
>>
>>strWhere = "[Flag] = " & CStr(Nz(Me!ReportFilter.Value, 0))
>>
>>so that you don't get an error if the user forgets to make a choice.
>>
> 
> 
> ***********************************************************************
> 
> Thanks again for your help!
> 
> Ruth
> 

Although it's possible to open one of several different reports from 
your code depending on which values the user selects, one of the 
beauties of creating SQL dynamically is that several different scenarios 
can be handled by a single report.  For example, you can set the Control 
Source for a text box on the report to something like:

="Report Flag: " & IIf(Not 
IsNull([Forms]![frmReportFilter]!ReportFilter.Column(1)), 
[Forms]![frmReportFilter]!ReportFilter.Column(1), "All")

Since you always have the [Flag] criterion in strWhere, you can tack on 
cboCustomer and cboAircraftType to the SQL criteria if they contain values:

If Not IsNull(cbxCustomer.Value) Then
   strWhere = strWhere & " AND [Customer] = " & Chr(34) & 
cbxCustomer.Value & Chr(34)
End If
If Not IsNull(cbxAircraftType.Value) Then
   strWhere = strWhere & " AND [AircraftType] = " & Chr(34) & 
cbxAircraftType.Value & Chr(34)
End If

or if you have ID's in column 0 as before:

If Not IsNull(cbxCustomer.Column(1)) Then
   strWhere = strWhere & " AND [Customer] = " & Chr(34) & 
cbxCustomer.Column(1) & Chr(34)
End If
If Not IsNull(cbxAircraftType.Column(1)) Then
   strWhere = strWhere & " AND [AircraftType] = " & Chr(34) & 
cbxAircraftType.Column(1) & Chr(34)
End If

Obviously, [Customer] and [AircraftType] should be changed to your 
actual field names if they are different.  You can double check the 
final strWhere using your debug statement.  You can also write out 
strWhere to a text file so that you can test out the SQL separately in 
the Query By Example (QBE) query design area by creating a new query, 
clicking on the SQL toolbar, then pasting the text for your query:

SELECT * FROM MyReportTable WHERE ...;

.... = strWhere text

James A. Fortune
MPAPoster@FortuneJames.com
0
James
5/1/2007 8:49:25 PM
Well darn. I KNOW I replied to this message this morning, but
evidently my post was eaten for breakfast!

James, I'm missing something. The code runs without error, debugging
doesn't show anything, but the additional combo boxes don't filter the
data any further.

Here's the code as I have it currently:

Private Sub Command0_Click()

Dim strReport As String
Dim strField As String
Dim strWhere As String
Const conDateFormat = "\#mm\/dd\/yyyy\#"
strReport = "rptJobDetailSumm"
strField = "Callin"
strWhere = "[Flag] = " & CStr(Nz(Me!ReportFilter.Value, 0))
If IsNull(Me.txtStartDate) Then
   If Not IsNull(Me.txtEndDate) Then
     strWhere = strField & " <= " & Format(Me.txtEndDate,
conDateFormat)
   End If
Else
   If IsNull(Me.txtEndDate) Then
     strWhere = strField & " >= " & Format(Me.txtStartDate,
conDateFormat)
   Else
     strWhere = strField & " Between " & Format(Me.txtStartDate,
conDateFormat) _
     & " And " & Format(Me.txtEndDate, conDateFormat)
   End If
End If
If Not IsNull(Me!ReportFilter.Value) Then
   If Me!ReportFilter.Value <> 0 Then
     If strWhere <> "" Then
       strWhere = "(" & strWhere & ") AND [Flag] = " & CStr(Me!
ReportFilter.Value)
     Else
       strWhere = "[Flag] = " & CStr(Me!ReportFilter.Value)
     End If
   End If
End If
' Code works to this point

If Not IsNull(cboCustomer.Column(1)) Then
   strWhere = strWhere & " AND [CustomerName] = " & Chr(34) &
cboCustomer.Column(1) & Chr(34)

End If
If Not IsNull(cboACType.Column(1)) Then
   strWhere = strWhere & " AND [AircraftType] = " & Chr(34) &
cboACType.Column(1) & Chr(34)
End If
' End new code addition

' Debug.Print strWhere
If strWhere <> "" Then
   DoCmd.OpenReport strReport, acViewPreview, , strWhere
Else
   DoCmd.OpenReport strReport, acViewPreview
   End If
            Exit Sub

' Debug.Print strWhere
If strWhere <> "" Then
   DoCmd.OpenReport strReport, acViewPreview, , strWhere
Else
   DoCmd.OpenReport strReport, acViewPreview
   End If
            Exit Sub

End Sub


Regards,
Ruth

0
Ruth
5/2/2007 7:26:01 PM
Ruth wrote:
> Well darn. I KNOW I replied to this message this morning, but
> evidently my post was eaten for breakfast!
> 
> James, I'm missing something. The code runs without error, debugging
> doesn't show anything, but the additional combo boxes don't filter the
> data any further.
> 
> Here's the code as I have it currently:
> 
> Private Sub Command0_Click()
> 
> Dim strReport As String
> Dim strField As String
> Dim strWhere As String
> Const conDateFormat = "\#mm\/dd\/yyyy\#"
> strReport = "rptJobDetailSumm"
> strField = "Callin"
> strWhere = "[Flag] = " & CStr(Nz(Me!ReportFilter.Value, 0))
> If IsNull(Me.txtStartDate) Then
>    If Not IsNull(Me.txtEndDate) Then
>      strWhere = strField & " <= " & Format(Me.txtEndDate,
> conDateFormat)
>    End If
> Else
>    If IsNull(Me.txtEndDate) Then
>      strWhere = strField & " >= " & Format(Me.txtStartDate,
> conDateFormat)
>    Else
>      strWhere = strField & " Between " & Format(Me.txtStartDate,
> conDateFormat) _
>      & " And " & Format(Me.txtEndDate, conDateFormat)
>    End If
> End If
> If Not IsNull(Me!ReportFilter.Value) Then
>    If Me!ReportFilter.Value <> 0 Then
>      If strWhere <> "" Then
>        strWhere = "(" & strWhere & ") AND [Flag] = " & CStr(Me!
> ReportFilter.Value)
>      Else
>        strWhere = "[Flag] = " & CStr(Me!ReportFilter.Value)
>      End If
>    End If
> End If
> ' Code works to this point
> 
> If Not IsNull(cboCustomer.Column(1)) Then
>    strWhere = strWhere & " AND [CustomerName] = " & Chr(34) &
> cboCustomer.Column(1) & Chr(34)
> 
> End If
> If Not IsNull(cboACType.Column(1)) Then
>    strWhere = strWhere & " AND [AircraftType] = " & Chr(34) &
> cboACType.Column(1) & Chr(34)
> End If
> ' End new code addition
> 
> ' Debug.Print strWhere
> If strWhere <> "" Then
>    DoCmd.OpenReport strReport, acViewPreview, , strWhere
> Else
>    DoCmd.OpenReport strReport, acViewPreview
>    End If
>             Exit Sub
> 
> ' Debug.Print strWhere
> If strWhere <> "" Then
>    DoCmd.OpenReport strReport, acViewPreview, , strWhere
> Else
>    DoCmd.OpenReport strReport, acViewPreview
>    End If
>             Exit Sub
> 
> End Sub
> 
> 
> Regards,
> Ruth
> 

Ruth,

Try it with an additional comma before strWhere.  For an explanation, 
see Access Help for OpenReport.

James A. Fortune
MPAPoster@FortuneJames.com
0
James
5/4/2007 10:00:37 PM
Reply:

Similar Artilces:

setting up new outlook mail account
i can not set up a new account on my outlook, i keep saying establish network connection with a correct sign but searching for my mail account shows X can you please advise Are you trying to setup a POP3 mail account or an Exchange account? Also, what version of Outlook are you using? "rashid" <rashid@discussions.microsoft.com> wrote in message news:C59D04C0-C1C9-4BD1-AE00-2009D25B221D@microsoft.com... > i can not set up a new account on my outlook, i keep saying establish > network > connection with a correct sign but searching for my mail account shows X > ...

How do I set up an argument which asks for multiple criteria
I am trying to use an argument that asks for one of three criteria (2345P, 8319T, or 7026J) in cell C108, and if it finds it, enters the amount of yet another cell, G108 into cell K108, and if not enters 0 into cell K108. It seems there are too many arguments for the "if" argument, and I can't seem to get the "lookup" argument to work either. Is there another argument I should be working with? Thanks -- Diver Try: =IF(OR(C108="8319T",C108="2345P",C108="7026J"),G108,0) "bj" wrote: > try in K108 > =if(or(c108=&qu...

Parameter driven report.
I have a report which takes date as a parameter. This works fine from within the reports section. But when i call the report from my customised button on the Accounts tab it does not work <server>/reports/viewer/html/viewer.aspx?id=4793?&promptex-Start+Date=22/04/2005 I always get Query engine error i have tried all these formats: a 22%2F04%2F2005 - dd/mm/yyyy b Date%282005%2C04%2C22%29 i.e. Date(yyyy,mm,dd) Any help will be appreciated ...

one label all forms
I want to put a label on all my forms that says YOU ARE IN ARCHIVE. Can I do this without placing a label on each form? Thanks. You could set the form's Caption to that. That would mean that it would appear in the bar at the top of the form. However, you'd have to set it, so I don't know whether that'll save you anything. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "seeker" <seeker@discussions.microsoft.com> wrote in message news:E4FC21F1-32F8-4A6E-A33B-EC9B18F9617D@microsoft.com... >I want...

Linked form can't be edited
I have a large table with contact details and also additional details which only relates to about a third of my clients. If I include all the fields in my main input form(1) it becomes very cluttered so I have created another form(2) for just the additional information and select it with a button from form(1). Form(2) is filtered according to the client in form(1). However even though I have enabled editing in the properties box, I am unable to edit the form(2) fields. Without the filter it works fine, but I have to find the client manually to add the additional information. What...

OWA Set Rule problem
I have successfully install the Exchange 2003 with SP1 in the Windows Server 2003. Anything alright exclude the rules function in OWA. I try to set the rules from any then "move to" or "copy to" specify folder are no problem, but "forward to" other email address, its don't work. I try to input the email address in the contact and then select from the contact, but the result also don't work. The rules can save and I can receive the incoming email in the Exchange 2003/Outlook or OWA, but it don't forward to my specify email address. I try to...

How do I set the 'Set Synchronizing Client' field
We have a number of outlook clients using CRM that have the 'Set Synchronizing Client' select box greyed out. We need to tick them so that they are able to synchronize tasks etc. Can any one help me find out why these are greyed out and then set them so that they can synchronize thanks In my experience, that checkbox is always greyed out for the first install that is performed for a user. The only time that checkbox becomes active is if a second copy of CRM is installed for a user who already has CRM installed on another PC.... Normally the box is checked and grey. If that is...

Access
I have a table that has 9 immunization dates in each record. I need to capture the most recent date for a report. All the information I have found refers to comparing dates between records, not within a single record. Hi Johanna Can I suggest you split your table. It's quite simple. 1st Make a copy of your database and work on the copy (just in case) Open the copy of your database Copy the table and paste with a new names tblA - tblB Open table A and delete all the immunization dates Open table B and delete everuthing "except" the immunization dates and the ID fiel...

range of dates schedule
I am trying to make a spreadsheet to show me when and how much a too was checked out of my work. i am inputing the dates and i would like the spreadsheet to tell me ho many days in each month it worked. please help, i have been working on this for 2 days -- Message posted from http://www.ExcelForum.com With your "Start date" in A1 and your "Finish date" in B1, put the following formula in C1 and format the cell for Number with no decimal places =B1-A1 Vaya con Dios, Chuck, CABGx3 "Coy Bruner >" <<Coy.Bruner.12gi7n@excelforum-nospam.com> wrote ...

Text and ranges.
How do you wrap text within a range? Hi not really sure what you're trying to do. Could you give an example? -- Regards Frank Kabel Frankfurt, Germany "jim252627" <jim252627@discussions.microsoft.com> schrieb im Newsbeitrag news:4D206631-71FA-48BE-82B4-3624D58A987D@microsoft.com... > How do you wrap text within a range? For example, if I am designing a form and one of the fields of the form requires text, the command would be "wrap-text" within the cell format command. However, if many columns are narrow because of fields (ranges) established above or ...

Remove unwanted fonts from drop down menu
I have a number of apparently Korean fonts such as @Batang, @Dotum, @Fang Song, etc. I want them removed. When I go to the Control Panel and the Font Icon, they are not listed. How do I remove them? ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.micros...

How to set backcolour
Hello All I have a continuous form containing a number field (long integer) called [v_colour]. This field contains the number of a certain colour - as per the numbers that are used in the format properties for back colour etc. I would like to set the back colour for the form's [v_colour] text box to be the value of the field: e.g. If the value of [v_colour] in the first record is 255, I want the back colour of the textbox for that record to be bright red. I tried this as the OnLoad event for the form: [v_colour].backcolour = [v_colour].value .... but this resulted in the back colour of...

Applying Percent Decrease Across Set Periods
I have a column which includes dates when items were purchased. I have used the DATEDIF function to find the number of years between that date and today's date. I now want to decrease the purchase amount 10% for every year calculated via the DATEDIF function. Any ideas, is this possible, why can't I think...? -- Hunt&amp;Peck ------------------------------------------------------------------------ Hunt&amp;Peck's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=32961 View this thread: http://www.excelforum.com/showthread.php?threadid=527873 ...

Copy formula for ranges from diff sheets #2
Unfortunatley then i have to go to every sheet, copy and paste special (transpose) What I need is some sort of formula that will copy the same range fro _all_sheets_ and then paste special (transpose) on to the referenc sheet. ? -- Berni ----------------------------------------------------------------------- Bernie's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1457 View this thread: http://www.excelforum.com/showthread.php?threadid=26197 Hi not possible with a formula. This would require VBA >-----Original Message----- > >Unfortunatley then i h...

Conditional Formatting: > and < a date
I am trying to use this forumla as a Conditional Format =0<DAY(D17-NOW())<=10 It does not work. If I remove the 0< or <=10, it will work. Any suggestions? =AND(0<DAY(D17-NOW()),DAY(D17-NOW())<=10) "Brad P" <bradp_xx@hotmail.com> wrote in message news:ftd89m$q0u$1@news.datemas.de... >I am trying to use this forumla as a Conditional Format > > =0<DAY(D17-NOW())<=10 > > It does not work. If I remove the 0< or <=10, it will work. Any > suggestions? > Excellent, thanks for that! "GerryGerry" <Gerry@Ger...

Set Regional Settings but not Language
Hi I have a multi-language APP en-US, es-ES, it-IT I usually change Languages and Locales by using the CultureInfo to switch Languages System.Globalization.CultureInfo myCI = new System.Globalization.CultureInfo("es-ES"); My issue is - what if the user wants to View App in english and use the Regional Options on a PC in say Spain ??? If I change the CultureInfo to en-US then they can view APP in English ( English satelite assemblies) but date and numbers will be in US format If I change the CultureInfo to es-ES then date and numbers will be in Spain forma...

Obtaining the correct results from a two table query
I have two tables say A and B, what I am trying to achieve with the query is just to display records that have the received field ticked in table A and the colour field in table B not containing �Y�. How do I modify the code below to achieve this? SELECT A_Date, A.Received, A.ID, B. Colour FROM A LEFT JOIN B ON DDP_A.Main = B.Main WHERE (((A.Received)= -1) AND ((B.Colour <> �Y�)); jo@jo.uk wrote: >I have two tables say A and B, what I am trying to achieve with the query is >just to display records that have the received field ticked in table A and >the colo...

Reading Pane Settings
I did a search for an answer to this question and have not found one. If I missed an answer already posted, please direct me to the right place. I have Outlook 2007 and set up the "right" reading pane for my e-mail. Now when I go to my calendar it is set up the same way - calendar on the left (same size as the inbox) and then there is a blank space to the right that is the size of the reading pane/preview. To the right is the to-do bar (which I have no problem with). I don't know why there is a reading/preview pane on the calendar when there is nothing to preview, and I...

Work Hours setting excludes specified hours from Scheduling
I am miffed by this problem. I specify a work hour schedule for a user. When I schedule a CRM User as a Resource for a Service in Scheduling of a Service Activity with Requested Time of ASAP and click Find Available Times, the values for Avilable Times returned are outside of the Work Hours I specified for the user and not within the work hours. When I drill into the Work Hours for this User, the Calendar view shows Cross Day rather than 8:00AM - 5:00PM I speciied for work hours and editing the hours reveal the correct hours in the Work Hours. What gives? Never mind. Figured out w...

synchronize sub forms-part 2
Don't see my earlier post... here I go again! Scenario: Main form (1)- frm1 based on tbl01 User enters 3 parameters to filter by p1,p2,p3 Subforms (6)- fsub1-fsub6 (each with its own tab) also based on tbl01 ALL subforms are Linked to frm1 through 2 fields (p2,p3) When the 3 parameters are chosen fsub1 will list the basic info associated with them. fsub2-fsub6 will list more specific info. With the following additions suggested by Robert Carlson: fsub1 On current Event: Forms![frm1]![fsub2].Requery fsub2 On Current Event: If IsNull(Forms![frm1]![fsub1].Form!ID) = False Then ...

Outlook "Arrange By" option does not retain its setting
In outlook 2007, I use a custom view for my inbox, and I have the Group By option checked to"Automatically group according to arrangement." This has been workn flawlessly until today, when I realized Outlook did not like a particular mouse click; perhaps I clicked on the border of two options or some other anomoly that caused the window toflash once. The end result was that my Arrange By option changed to "From" when I had previously set it to "Conversation." Now, whenever I hange it backto "Conversation," leave the inbox and come back, ...

Propagate Lead Form Changes
I added some new values for Lead Source in the Lead form yesterday. My IT manager who's unavailable and normally does this sort of thing told me that many changes like this just "take a while" to propagate out system wide. How long does it take, or do I need to do something to publish my changes? I can see that they're saved because if I go back to edit the values for that field, they're all in there. Thanks Nathan, You need to publish the changes from the deployment manager. Usually you need to restart IIS (just Start - Run - iisreset will do the trick). T...

interactive buttons, multiple sets
hi folks I'm sure one of you good folks will save my bacon as usual I have a series of websites, all of which exhibit the same odd behavior with interactive buttons. I have a bunch of buttons in the left margin, each of which pulls up ( lets call it ) a chapter, and in each 'chapter' are a number of related pages. On the top of each page is an imbedded page which has 'page numbers' for all the 'pages' in that chapter. So, it's a grid where the 'vertical' buttons in the left margin and the 'horizontal' buttons at the top comb...

How do I set OOR
I have searched the help menu and have had no luck finding out how to set my outlook 200 to send an OOR (Out of Office Reply) Any assistance would be great If you are in an Exchange environment (ask your administrator if you do notknow) you can set the Out of the Office Assistant which is located under Tools. If you are not in an Exchange environment you can create a rule that replies on all e-mails. The downside of this is that you'll have to have your Outlook open all the time for the rules to process. Make sure you set some exceptions (for instance based on the subject field so ...

Java vs. C++ (Date class)
I'm porting some Java code into C++. Which class I should use instead Date class? Note that Date support miliseconds. Also, which class I should use instead of Vector class? std::vector? "Petar Popara" <my.fake@mail.net> wrote in message news:uG6VGpUfFHA.2424@TK2MSFTNGP09.phx.gbl... > > I'm porting some Java code into C++. Which class I should use instead Date > class? Note that Date support miliseconds. Oh dear. Both the Java and the C++ date classes do assorted odd things with time zones and "daylight saving"; neither is documented fully or ...