From: swarfmaker on

"fredg" <fgutkind(a)example.invalid> wrote in message
news:1svxfkja6fydr$.1clbq1dwiqgn6.dlg(a)40tude.net...
> On Wed, 9 Jul 2008 22:18:53 +0100, swarfmaker wrote:
>
>> "fredg" <fgutkind(a)example.invalid> wrote in message
>> news:1b7l1iaz1dnxu.1l722essub4j0.dlg(a)40tude.net...
>>> On Tue, 8 Jul 2008 20:33:46 +0100, swarfmaker wrote:
>>>
>>>> Access 2003 on WindowsXP Pro SP2
>>>>
>>>> If I put the following expression into an unbound control:
>>>> =Trim("Training between "&Format(Now()"d mmmm yyyy")&" &
>>>> "&Format((Now()+30),"d mmmm yyyy")
>>>>
>>>> I get the following result:
>>>>
>>>> Between 8 July 2008 & 7 Augu23t 2008
>>>>
>>>> The figures embedded in "August" change every time the report is run.
>>>>
>>>> There are no missing references and the database compiles properly.
>>>>
>>>> Any ideas?
>>>>
>>>> Iain.
>>>
>>> Why do you need the Trim() function here?
>>> You're missing a comma in the first Format argument position.
>>> V
>>> Format(Now()"d mmmm yyyy")
>>>
>>> You don't need the extra set of parenthesis in the
>>> V V
>>> Format((Now()+30), d mmmm yyyy") expression.
>>>
>>> Now() includes a time value, which you are not using here.
>>> Use Date() instead.
>>>
>>> =Trim("Training between " & Format(Date(),"d mmmm yyyy") & " & " &
>>> Format(Date()+30,"d mmmm yyyy"))
>>>
>>>
>>> --
>>> Fred
>>> Please respond only to this newsgroup.
>>> I do not reply to personal e-mail
>>
>> I still get the same result with these changes.
>> Also, if I change the & within the Quote marks to "and" that displays the
>> same behaviour i.e. a mixture of letters and numbers.
>>
>> Iain
>
> You're telling us what you did, but you're not showing us.
> Please copy and paste the exact control source expression you are
> using. Do NOT just re-type it.
>
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail

Hi Fred,
Here is the expression copied and pasted
=Trim("Training scheduled to commence between " & Format(Date()+1,"d mmmm
yyyy" & " & " & Format(Now()+30,"d mmmm yyyy"))
This gives me: "Training scheduled to commence between 11 July 2008 & 9
Augu0t 2008"

If I try this:
=Trim("Training scheduled to commence between " & Format(Date()+1,"d mmmm
yyyy" & " and " & Format(Now()+30,"d mmmm yyyy")))
I get: "Training scheduled to commence between 11 July 2008 a011 9 augu0t
2008"

Any ideas?

Iain


From: John Spencer on
Try the following

=Trim("Training scheduled to commence between " & Format(Date()+1,"d mmmm
yyyy") & " and " & Format(Now()+30,"d mmmm yyyy"))

You had your parentheses in the wrong places
=Trim("Training scheduled to commence between " & Format(Date()+1,"d mmmm
yyyy" ^^^ need one here ^^^ & " and " & Format(Now()+30,"d mmmm yyyy"))^^^ one
extra one here ^^^)

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County

swarfmaker wrote:
> "fredg" <fgutkind(a)example.invalid> wrote in message
> news:1svxfkja6fydr$.1clbq1dwiqgn6.dlg(a)40tude.net...
>> On Wed, 9 Jul 2008 22:18:53 +0100, swarfmaker wrote:
>>
>>> "fredg" <fgutkind(a)example.invalid> wrote in message
>>> news:1b7l1iaz1dnxu.1l722essub4j0.dlg(a)40tude.net...
>>>> On Tue, 8 Jul 2008 20:33:46 +0100, swarfmaker wrote:
>>>>
>>>>> Access 2003 on WindowsXP Pro SP2
>>>>>
>>>>> If I put the following expression into an unbound control:
>>>>> =Trim("Training between "&Format(Now()"d mmmm yyyy")&" &
>>>>> "&Format((Now()+30),"d mmmm yyyy")
>>>>>
>>>>> I get the following result:
>>>>>
>>>>> Between 8 July 2008 & 7 Augu23t 2008
>>>>>
>>>>> The figures embedded in "August" change every time the report is run.
>>>>>
>>>>> There are no missing references and the database compiles properly.
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> Iain.
>>>> Why do you need the Trim() function here?
>>>> You're missing a comma in the first Format argument position.
>>>> V
>>>> Format(Now()"d mmmm yyyy")
>>>>
>>>> You don't need the extra set of parenthesis in the
>>>> V V
>>>> Format((Now()+30), d mmmm yyyy") expression.
>>>>
>>>> Now() includes a time value, which you are not using here.
>>>> Use Date() instead.
>>>>
>>>> =Trim("Training between " & Format(Date(),"d mmmm yyyy") & " & " &
>>>> Format(Date()+30,"d mmmm yyyy"))
>>>>
>>>>
>>>> --
>>>> Fred
>>>> Please respond only to this newsgroup.
>>>> I do not reply to personal e-mail
>>> I still get the same result with these changes.
>>> Also, if I change the & within the Quote marks to "and" that displays the
>>> same behaviour i.e. a mixture of letters and numbers.
>>>
>>> Iain
>> You're telling us what you did, but you're not showing us.
>> Please copy and paste the exact control source expression you are
>> using. Do NOT just re-type it.
>>
>> --
>> Fred
>> Please respond only to this newsgroup.
>> I do not reply to personal e-mail
>
> Hi Fred,
> Here is the expression copied and pasted
> =Trim("Training scheduled to commence between " & Format(Date()+1,"d mmmm
> yyyy" & " & " & Format(Now()+30,"d mmmm yyyy"))
> This gives me: "Training scheduled to commence between 11 July 2008 & 9
> Augu0t 2008"
>
> If I try this:
> =Trim("Training scheduled to commence between " & Format(Date()+1,"d mmmm
> yyyy" & " and " & Format(Now()+30,"d mmmm yyyy")))
> I get: "Training scheduled to commence between 11 July 2008 a011 9 augu0t
> 2008"
>
> Any ideas?
>
> Iain
>
>