Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Iif function not functioning in another computer

Geek News

Iif function not functioning in another computer
Mishanya 12/9/2008 11:21:01 AM
I have a few unbound text boxes in my form wich show totals from the form'
subforms. The formula (in general names) is:
=IIf([Subform].[Form].[RecordsetClone].[RecordCount]>0,[Subform].[Form]![Total],0)

When I copy the DB to the user' computer, I get #Name?. The formula is
working, though, if I leave only [Subform].[Form]![Total], without using the
Iif function.

I've made sure that Windows Regional and Language Options are the same in
both computers (i.e. list separators, language for non-Unicode programs
etc.), so the syntax can't be a problem.

What else may I check in order to solve the problem?

Re: Iif function not functioning in another computer
"Allen Browne" <AllenBrowne[ at ]SeeSig.Invalid> 12/9/2008 11:50:36 AM
Is your user on Access 2007?

There's a bug in the new version where that expression doesn't work. See:
Avoid #Error in form/report with no records
at:
http://allenbrowne.com/RecordCountError.html

The article explains how to create a little wrapper function that does work
(assuming that they have the database in a trusted location.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Mishanya" <Mishanya[ at ]discussions.microsoft.com> wrote in message
news:65BF6EA2-E19B-4D98-B8D6-6CD85C5374DE[ at ]microsoft.com...
[Quoted Text]
>I have a few unbound text boxes in my form wich show totals from the form'
> subforms. The formula (in general names) is:
>
> =IIf([Subform].[Form].[RecordsetClone].[RecordCount]>0,[Subform].[Form]![Total],0)
>
> When I copy the DB to the user' computer, I get #Name?. The formula is
> working, though, if I leave only [Subform].[Form]![Total], without using
> the
> Iif function.
>
> I've made sure that Windows Regional and Language Options are the same in
> both computers (i.e. list separators, language for non-Unicode programs
> etc.), so the syntax can't be a problem.
>
> What else may I check in order to solve the problem?

Re: Iif function not functioning in another computer
Mishanya 12/9/2008 1:03:00 PM
Hi Allen.
My user has Access 2003 (most probably same version as mine).
In my comp I use RecordsetClone expression. Your tip uses Recordset. I
tested Recordset expression in my comp, and it still works (I don't really
know what is the difference between RecordsetClone and Recordset expressions).
On the contrary, in my user' comp, when having expression RecordsetClone
(wich did not work) changed to Recordset, I get msgbox:

"Access failed to evaluate one or more expressions because "Recordset" was
referenced in an expression. Only functions and properties that are
considered to be safe are allowed to be in expressions when Access runs in
Sandbox mode"

What do U think of that?




Allen Browne" wrote:

[Quoted Text]
> Is your user on Access 2007?
>
> There's a bug in the new version where that expression doesn't work. See:
> Avoid #Error in form/report with no records
> at:
> http://allenbrowne.com/RecordCountError.html
>
> The article explains how to create a little wrapper function that does work
> (assuming that they have the database in a trusted location.)
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Mishanya" <Mishanya[ at ]discussions.microsoft.com> wrote in message
> news:65BF6EA2-E19B-4D98-B8D6-6CD85C5374DE[ at ]microsoft.com...
> >I have a few unbound text boxes in my form wich show totals from the form'
> > subforms. The formula (in general names) is:
> >
> > =IIf([Subform].[Form].[RecordsetClone].[RecordCount]>0,[Subform].[Form]![Total],0)
> >
> > When I copy the DB to the user' computer, I get #Name?. The formula is
> > working, though, if I leave only [Subform].[Form]![Total], without using
> > the
> > Iif function.
> >
> > I've made sure that Windows Regional and Language Options are the same in
> > both computers (i.e. list separators, language for non-Unicode programs
> > etc.), so the syntax can't be a problem.
> >
> > What else may I check in order to solve the problem?
>
>
Re: Iif function not functioning in another computer
Mishanya 12/9/2008 1:16:09 PM
Hi again!
After reading Your tip, changing RecordsetClone expression to Recordset and
getting an error msgbox, I've googgled on the msgbox content (about safety,
sandbox etc.) and found that it may be a safety issue.
I've changed Macro safety level to Low in my user' comp - and that made a
trick. Now the formuls works.
I hope, lowing the safety level is not punishible in my case, although maybe
it is better to have a way to deal with no-records-#errors without messing
with the safety?

"Allen Browne" wrote:

[Quoted Text]
> Is your user on Access 2007?
>
> There's a bug in the new version where that expression doesn't work. See:
> Avoid #Error in form/report with no records
> at:
> http://allenbrowne.com/RecordCountError.html
>
> The article explains how to create a little wrapper function that does work
> (assuming that they have the database in a trusted location.)
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Mishanya" <Mishanya[ at ]discussions.microsoft.com> wrote in message
> news:65BF6EA2-E19B-4D98-B8D6-6CD85C5374DE[ at ]microsoft.com...
> >I have a few unbound text boxes in my form wich show totals from the form'
> > subforms. The formula (in general names) is:
> >
> > =IIf([Subform].[Form].[RecordsetClone].[RecordCount]>0,[Subform].[Form]![Total],0)
> >
> > When I copy the DB to the user' computer, I get #Name?. The formula is
> > working, though, if I leave only [Subform].[Form]![Total], without using
> > the
> > Iif function.
> >
> > I've made sure that Windows Regional and Language Options are the same in
> > both computers (i.e. list separators, language for non-Unicode programs
> > etc.), so the syntax can't be a problem.
> >
> > What else may I check in order to solve the problem?
>
>
Re: Iif function not functioning in another computer
Tom van Stiphout <tom7744.no.spam[ at ]cox.net> 12/9/2008 2:00:13 PM
On Tue, 9 Dec 2008 05:16:09 -0800, Mishanya
<Mishanya[ at ]discussions.microsoft.com> wrote:

Alternatively you would digitally sign your database.

-Tom.
Microsoft Access MVP


[Quoted Text]
>Hi again!
>After reading Your tip, changing RecordsetClone expression to Recordset and
>getting an error msgbox, I've googgled on the msgbox content (about safety,
>sandbox etc.) and found that it may be a safety issue.
>I've changed Macro safety level to Low in my user' comp - and that made a
>trick. Now the formuls works.
>I hope, lowing the safety level is not punishible in my case, although maybe
>it is better to have a way to deal with no-records-#errors without messing
>with the safety?
>
>"Allen Browne" wrote:
>
>> Is your user on Access 2007?
>>
>> There's a bug in the new version where that expression doesn't work. See:
>> Avoid #Error in form/report with no records
>> at:
>> http://allenbrowne.com/RecordCountError.html
>>
>> The article explains how to create a little wrapper function that does work
>> (assuming that they have the database in a trusted location.)
>>
>> --
>> Allen Browne - Microsoft MVP. Perth, Western Australia
>> Tips for Access users - http://allenbrowne.com/tips.html
>> Reply to group, rather than allenbrowne at mvps dot org.
>>
>> "Mishanya" <Mishanya[ at ]discussions.microsoft.com> wrote in message
>> news:65BF6EA2-E19B-4D98-B8D6-6CD85C5374DE[ at ]microsoft.com...
>> >I have a few unbound text boxes in my form wich show totals from the form'
>> > subforms. The formula (in general names) is:
>> >
>> > =IIf([Subform].[Form].[RecordsetClone].[RecordCount]>0,[Subform].[Form]![Total],0)
>> >
>> > When I copy the DB to the user' computer, I get #Name?. The formula is
>> > working, though, if I leave only [Subform].[Form]![Total], without using
>> > the
>> > Iif function.
>> >
>> > I've made sure that Windows Regional and Language Options are the same in
>> > both computers (i.e. list separators, language for non-Unicode programs
>> > etc.), so the syntax can't be a problem.
>> >
>> > What else may I check in order to solve the problem?
>>
>>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net