PC Review


Reply
Thread Tools Rate Thread

Conditional Results

 
 
=?Utf-8?B?bWNjbG91ZA==?=
Guest
Posts: n/a
 
      16th Aug 2005
I have an Access database query that feeds a frontpage web site. I have a
text field and a Currency field. My question is there a way to populate a
default value when the field is blank. For example in the text field when
blank display" Call" and in the Currency field dispaly "0".

Thanks in advance for your help!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2F0aGxlZW4gQW5kZXJzb24gW01WUCAtIEZyb250
Guest
Posts: n/a
 
      16th Aug 2005
You can wrap the DatabaseResultsColumn in some script - here's an example:


<% If fp_rs("Municipality") > " " then %>


<li><b>Municipality:</b> Â*<!--webbot bot="DatabaseResultColumn"
startspan


s-columnnames="ProgramArea,RecÂ*ordNum,Date,ItemNumber,SplitItÂ*em,Session,PA_SA
,ActNumber,Section,Recipient,MÂ*unicipality,FundsUse,DollarFieÂ*ld1,DollarField2
,DollarField3,DollarField4,AnyÂ*_Previous,DollarField5,FundNumÂ*,AgencyNum,SID,P
roject_Num,Description"
s-column="Municipality" b-tableformat="FALSE" b-hashtml="FALSE"
clientside
preview="<font
size="-1">&ltÂ*;&lt;</font>MunicipaÂ*lity<font
size="-1">&gtÂ*;&gt;</font>" b-makelink
b-MenuFormat --><%=FP_FieldVal(fp_rs,"MunicÂ*ipality")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="33247" --></li>


<% End If %>


You can also check the value of one field to determine whether to show
another.



--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/



"mccloud" wrote:

> I have an Access database query that feeds a frontpage web site. I have a
> text field and a Currency field. My question is there a way to populate a
> default value when the field is blank. For example in the text field when
> blank display" Call" and in the Currency field dispaly "0".
>
> Thanks in advance for your help!

 
Reply With Quote
 
Paul M
Guest
Posts: n/a
 
      16th Aug 2005
Hi
You can open the database table in access click on the veiw button (top
left)and set the default to 0 for number fields or text for text fields if
you use text put the text in quotes "Call". then when the database is
being populated if nothing is entered into the field it will display the
default
Paul M
"mccloud" <(E-Mail Removed)> wrote in message
news:E5AA9FE0-A55F-45AD-86E1-(E-Mail Removed)...
>I have an Access database query that feeds a frontpage web site. I have a
> text field and a Currency field. My question is there a way to populate a
> default value when the field is blank. For example in the text field when
> blank display" Call" and in the Currency field dispaly "0".
>
> Thanks in advance for your help!



 
Reply With Quote
 
Kathleen Anderson [MVP - FrontPage]
Guest
Posts: n/a
 
      16th Aug 2005
I believe he is asking how to populate the field on a query results page,
not populate the database field during an update.

--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
web: http://www.spiderwebwoman.com/resources/


"Paul M" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
> You can open the database table in access click on the veiw button (top
> left)and set the default to 0 for number fields or text for text fields if
> you use text put the text in quotes "Call". then when the database is
> being populated if nothing is entered into the field it will display the
> default
> Paul M
> "mccloud" <(E-Mail Removed)> wrote in message
> news:E5AA9FE0-A55F-45AD-86E1-(E-Mail Removed)...
>>I have an Access database query that feeds a frontpage web site. I have a
>> text field and a Currency field. My question is there a way to populate
>> a
>> default value when the field is blank. For example in the text field
>> when
>> blank display" Call" and in the Currency field dispaly "0".
>>
>> Thanks in advance for your help!

>
>



 
Reply With Quote
 
Thomas A. Rowe
Guest
Posts: n/a
 
      16th Aug 2005
However Paul M, solution would also solve the problem, as the fields would never be empty, therefore
no test (IF statement) would be need to determine if the field is empty

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

"Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I believe he is asking how to populate the field on a query results page, not populate the database
>field during an update.
>
> --
> ~ Kathleen Anderson
> Microsoft MVP - FrontPage
> Spider Web Woman Designs
> web: http://www.spiderwebwoman.com/resources/
>
>
> "Paul M" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>> Hi
>> You can open the database table in access click on the veiw button (top left)and set the
>> default to 0 for number fields or text for text fields if you use text put the text in quotes
>> "Call". then when the database is being populated if nothing is entered into the field it will
>> display the default
>> Paul M
>> "mccloud" <(E-Mail Removed)> wrote in message
>> news:E5AA9FE0-A55F-45AD-86E1-(E-Mail Removed)...
>>>I have an Access database query that feeds a frontpage web site. I have a
>>> text field and a Currency field. My question is there a way to populate a
>>> default value when the field is blank. For example in the text field when
>>> blank display" Call" and in the Currency field dispaly "0".
>>>
>>> Thanks in advance for your help!

>>
>>

>
>



 
Reply With Quote
 
Stefan B Rusynko
Guest
Posts: n/a
 
      17th Aug 2005
I would agree setting a known default is a better option because it doesn't require any testing

The test that was posted checks for a space (> " ") as a Boolean result
<% If fp_rs("Municipality") > " " then %>
That is a Boolean comparison for > " "
- not a zero-length string ("") test,
Which will fail (evaluate to False) if there is a character = " " in the field, or any other character in the field evaluating to or
less than a space

Probably better to check for a string length (rather than a space or zero-length string)
<% If Len(fp_rs("Municipality"))> 0 then %>

And that also doesn't check for a Null field as opposed to an empty string or zero-length string
At best it should also check for any Null as say:
<% If ( Not IsNull(fp_rs("Municipality")) ) OR ( Len(fp_rs("Municipality"))> 0 ) Then %>
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________


"Thomas A. Rowe" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
| However Paul M, solution would also solve the problem, as the fields would never be empty, therefore
| no test (IF statement) would be need to determine if the field is empty
|
| --
| ==============================================
| Thomas A. Rowe (Microsoft MVP - FrontPage)
| ==============================================
| If you feel your current issue is a results of installing
| a Service Pack or security update, please contact
| Microsoft Product Support Services:
| http://support.microsoft.com
| If the problem can be shown to have been caused by a
| security update, then there is usually no charge for the call.
| ==============================================
|
| "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in message
| news:(E-Mail Removed)...
| >I believe he is asking how to populate the field on a query results page, not populate the database
| >field during an update.
| >
| > --
| > ~ Kathleen Anderson
| > Microsoft MVP - FrontPage
| > Spider Web Woman Designs
| > web: http://www.spiderwebwoman.com/resources/
| >
| >
| > "Paul M" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
| >> Hi
| >> You can open the database table in access click on the veiw button (top left)and set the
| >> default to 0 for number fields or text for text fields if you use text put the text in quotes
| >> "Call". then when the database is being populated if nothing is entered into the field it will
| >> display the default
| >> Paul M
| >> "mccloud" <(E-Mail Removed)> wrote in message
| >> news:E5AA9FE0-A55F-45AD-86E1-(E-Mail Removed)...
| >>>I have an Access database query that feeds a frontpage web site. I have a
| >>> text field and a Currency field. My question is there a way to populate a
| >>> default value when the field is blank. For example in the text field when
| >>> blank display" Call" and in the Currency field dispaly "0".
| >>>
| >>> Thanks in advance for your help!
| >>
| >>
| >
| >
|
|


 
Reply With Quote
 
Kathleen Anderson [MVP - FrontPage]
Guest
Posts: n/a
 
      17th Aug 2005
True.

--

~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
web: http://www.spiderwebwoman.com/resources/




"Thomas A. Rowe" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> However Paul M, solution would also solve the problem, as the fields would
> never be empty, therefore no test (IF statement) would be need to
> determine if the field is empty
>
> --
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> ==============================================
> If you feel your current issue is a results of installing
> a Service Pack or security update, please contact
> Microsoft Product Support Services:
> http://support.microsoft.com
> If the problem can be shown to have been caused by a
> security update, then there is usually no charge for the call.
> ==============================================
>
> "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>>I believe he is asking how to populate the field on a query results page,
>>not populate the database field during an update.
>>
>> --
>> ~ Kathleen Anderson
>> Microsoft MVP - FrontPage
>> Spider Web Woman Designs
>> web: http://www.spiderwebwoman.com/resources/
>>
>>
>> "Paul M" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Hi
>>> You can open the database table in access click on the veiw button
>>> (top left)and set the default to 0 for number fields or text for text
>>> fields if you use text put the text in quotes "Call". then when the
>>> database is being populated if nothing is entered into the field it will
>>> display the default
>>> Paul M
>>> "mccloud" <(E-Mail Removed)> wrote in message
>>> news:E5AA9FE0-A55F-45AD-86E1-(E-Mail Removed)...
>>>>I have an Access database query that feeds a frontpage web site. I have
>>>>a
>>>> text field and a Currency field. My question is there a way to
>>>> populate a
>>>> default value when the field is blank. For example in the text field
>>>> when
>>>> blank display" Call" and in the Currency field dispaly "0".
>>>>
>>>> Thanks in advance for your help!
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
=?Utf-8?B?bWNjbG91ZA==?=
Guest
Posts: n/a
 
      17th Aug 2005
I am trying to populate a field on a results page. However the query is
linked to a SQL table that I can't change. I was able to get the number
field to work by using "Compatible Price: IIf([cap-Price]="
","NA",([cap-Price]))" but the text field must be defined differntly because
this doesn't work "Compatible: IIf([dbo_imitmidx_sql].[user_def_fld_3]="
","Coming Soon",([dbo_imitmidx_sql].[user_def_fld_3]))"
Any ideas?

"Thomas A. Rowe" wrote:

> However Paul M, solution would also solve the problem, as the fields would never be empty, therefore
> no test (IF statement) would be need to determine if the field is empty
>
> --
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> ==============================================
> If you feel your current issue is a results of installing
> a Service Pack or security update, please contact
> Microsoft Product Support Services:
> http://support.microsoft.com
> If the problem can be shown to have been caused by a
> security update, then there is usually no charge for the call.
> ==============================================
>
> "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >I believe he is asking how to populate the field on a query results page, not populate the database
> >field during an update.
> >
> > --
> > ~ Kathleen Anderson
> > Microsoft MVP - FrontPage
> > Spider Web Woman Designs
> > web: http://www.spiderwebwoman.com/resources/
> >
> >
> > "Paul M" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> >> Hi
> >> You can open the database table in access click on the veiw button (top left)and set the
> >> default to 0 for number fields or text for text fields if you use text put the text in quotes
> >> "Call". then when the database is being populated if nothing is entered into the field it will
> >> display the default
> >> Paul M
> >> "mccloud" <(E-Mail Removed)> wrote in message
> >> news:E5AA9FE0-A55F-45AD-86E1-(E-Mail Removed)...
> >>>I have an Access database query that feeds a frontpage web site. I have a
> >>> text field and a Currency field. My question is there a way to populate a
> >>> default value when the field is blank. For example in the text field when
> >>> blank display" Call" and in the Currency field dispaly "0".
> >>>
> >>> Thanks in advance for your help!
> >>
> >>

> >
> >

>
>
>

 
Reply With Quote
 
Thomas A. Rowe
Guest
Posts: n/a
 
      17th Aug 2005
Question: If one field is empty, does this mean the other field is also empty? If this is always so,
then this can be solve easily with a single IF statement at the point of display.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

"mccloud" <(E-Mail Removed)> wrote in message
news:304EDE1C-A2DE-472F-8C68-(E-Mail Removed)...
>I am trying to populate a field on a results page. However the query is
> linked to a SQL table that I can't change. I was able to get the number
> field to work by using "Compatible Price: IIf([cap-Price]="
> ","NA",([cap-Price]))" but the text field must be defined differntly because
> this doesn't work "Compatible: IIf([dbo_imitmidx_sql].[user_def_fld_3]="
> ","Coming Soon",([dbo_imitmidx_sql].[user_def_fld_3]))"
> Any ideas?
>
> "Thomas A. Rowe" wrote:
>
>> However Paul M, solution would also solve the problem, as the fields would never be empty,
>> therefore
>> no test (IF statement) would be need to determine if the field is empty
>>
>> --
>> ==============================================
>> Thomas A. Rowe (Microsoft MVP - FrontPage)
>> ==============================================
>> If you feel your current issue is a results of installing
>> a Service Pack or security update, please contact
>> Microsoft Product Support Services:
>> http://support.microsoft.com
>> If the problem can be shown to have been caused by a
>> security update, then there is usually no charge for the call.
>> ==============================================
>>
>> "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> >I believe he is asking how to populate the field on a query results page, not populate the
>> >database
>> >field during an update.
>> >
>> > --
>> > ~ Kathleen Anderson
>> > Microsoft MVP - FrontPage
>> > Spider Web Woman Designs
>> > web: http://www.spiderwebwoman.com/resources/
>> >
>> >
>> > "Paul M" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>> >> Hi
>> >> You can open the database table in access click on the veiw button (top left)and set the
>> >> default to 0 for number fields or text for text fields if you use text put the text in quotes
>> >> "Call". then when the database is being populated if nothing is entered into the field it will
>> >> display the default
>> >> Paul M
>> >> "mccloud" <(E-Mail Removed)> wrote in message
>> >> news:E5AA9FE0-A55F-45AD-86E1-(E-Mail Removed)...
>> >>>I have an Access database query that feeds a frontpage web site. I have a
>> >>> text field and a Currency field. My question is there a way to populate a
>> >>> default value when the field is blank. For example in the text field when
>> >>> blank display" Call" and in the Currency field dispaly "0".
>> >>>
>> >>> Thanks in advance for your help!
>> >>
>> >>
>> >
>> >

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?bWNjbG91ZA==?=
Guest
Posts: n/a
 
      17th Aug 2005
No they are seperate conditions.

"Thomas A. Rowe" wrote:

> Question: If one field is empty, does this mean the other field is also empty? If this is always so,
> then this can be solve easily with a single IF statement at the point of display.
>
> --
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> ==============================================
> If you feel your current issue is a results of installing
> a Service Pack or security update, please contact
> Microsoft Product Support Services:
> http://support.microsoft.com
> If the problem can be shown to have been caused by a
> security update, then there is usually no charge for the call.
> ==============================================
>
> "mccloud" <(E-Mail Removed)> wrote in message
> news:304EDE1C-A2DE-472F-8C68-(E-Mail Removed)...
> >I am trying to populate a field on a results page. However the query is
> > linked to a SQL table that I can't change. I was able to get the number
> > field to work by using "Compatible Price: IIf([cap-Price]="
> > ","NA",([cap-Price]))" but the text field must be defined differntly because
> > this doesn't work "Compatible: IIf([dbo_imitmidx_sql].[user_def_fld_3]="
> > ","Coming Soon",([dbo_imitmidx_sql].[user_def_fld_3]))"
> > Any ideas?
> >
> > "Thomas A. Rowe" wrote:
> >
> >> However Paul M, solution would also solve the problem, as the fields would never be empty,
> >> therefore
> >> no test (IF statement) would be need to determine if the field is empty
> >>
> >> --
> >> ==============================================
> >> Thomas A. Rowe (Microsoft MVP - FrontPage)
> >> ==============================================
> >> If you feel your current issue is a results of installing
> >> a Service Pack or security update, please contact
> >> Microsoft Product Support Services:
> >> http://support.microsoft.com
> >> If the problem can be shown to have been caused by a
> >> security update, then there is usually no charge for the call.
> >> ==============================================
> >>
> >> "Kathleen Anderson [MVP - FrontPage]" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >> >I believe he is asking how to populate the field on a query results page, not populate the
> >> >database
> >> >field during an update.
> >> >
> >> > --
> >> > ~ Kathleen Anderson
> >> > Microsoft MVP - FrontPage
> >> > Spider Web Woman Designs
> >> > web: http://www.spiderwebwoman.com/resources/
> >> >
> >> >
> >> > "Paul M" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> >> >> Hi
> >> >> You can open the database table in access click on the veiw button (top left)and set the
> >> >> default to 0 for number fields or text for text fields if you use text put the text in quotes
> >> >> "Call". then when the database is being populated if nothing is entered into the field it will
> >> >> display the default
> >> >> Paul M
> >> >> "mccloud" <(E-Mail Removed)> wrote in message
> >> >> news:E5AA9FE0-A55F-45AD-86E1-(E-Mail Removed)...
> >> >>>I have an Access database query that feeds a frontpage web site. I have a
> >> >>> text field and a Currency field. My question is there a way to populate a
> >> >>> default value when the field is blank. For example in the text field when
> >> >>> blank display" Call" and in the Currency field dispaly "0".
> >> >>>
> >> >>> Thanks in advance for your help!
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using query results within Conditional Statement...sequenced conditional queries rafael.farias.jr@gmail.com Microsoft Access 3 30th Aug 2006 02:08 PM
Conditional Sum Argument results do not equal cell results Excel =?Utf-8?B?UmFuZHkgUiBNdWxsaW5z?= Microsoft Excel Worksheet Functions 3 9th Aug 2006 07:16 PM
Conditional formula results Scott M. Microsoft Excel Discussion 4 9th Jun 2005 06:01 PM
Conditional format results in #Name? =?Utf-8?B?ZGF2ZSBr?= Microsoft Access Reports 0 11th Apr 2005 05:17 PM
Conditional Results =?Utf-8?B?QmlsbA==?= Microsoft Excel Worksheet Functions 3 21st Apr 2004 06:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:59 PM.