PC Review


Reply
Thread Tools Rate Thread

Detail format problem!

 
 
Domac
Guest
Posts: n/a
 
      1st Sep 2006
Hi,


I would like to set foreground color of textbox on subform depending on
value of booleann field.
Problem is that i can't catch event Detail_format that i used when doing
same task on report.

If value is 1 then color of textbox is red if it is 0 then color is black.

Subform is in continuos form view and I can't get detail_format event !!??

Please help!
Domagoj



 
Reply With Quote
 
 
 
 
Jeff L
Guest
Posts: n/a
 
      1st Sep 2006
Take a look at conditional formatting. I think that will do what you
are looking for.


Domac wrote:
> Hi,
>
>
> I would like to set foreground color of textbox on subform depending on
> value of booleann field.
> Problem is that i can't catch event Detail_format that i used when doing
> same task on report.
>
> If value is 1 then color of textbox is red if it is 0 then color is black.
>
> Subform is in continuos form view and I can't get detail_format event !!??
>
> Please help!
> Domagoj


 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      1st Sep 2006
Forms are very different than reports, and have different events.

The Current event of the form fires when a record becomes current. But if
this is a continuous form or datasheet, you will not be able to use code in
this event: all rows will change, not just the current row.

Instead, use Condtional Formatting.
(This assumes Access 2000 or later.)

Open the form in design view.
Select the text box that should change color.
Choose Conditional Formatting on the Format menu.
Set Condition 1 to:
Expression ([MyBoolean])
and click the red text.
Use the name of your boolean field instead of MyBoolean.

(Note that True is -1 rather than 1 if you are talking about a yes/no field
in an Access table.)

--
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.

"Domac" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> I would like to set foreground color of textbox on subform depending on
> value of booleann field.
> Problem is that i can't catch event Detail_format that i used when doing
> same task on report.
>
> If value is 1 then color of textbox is red if it is 0 then color is black.
>
> Subform is in continuos form view and I can't get detail_format event !!??
>
> Please help!
> Domagoj



 
Reply With Quote
 
Jeff L
Guest
Posts: n/a
 
      1st Sep 2006
Oops! Sorry Allen. I misread the post!

Allen Browne wrote:
> Forms are very different than reports, and have different events.
>
> The Current event of the form fires when a record becomes current. But if
> this is a continuous form or datasheet, you will not be able to use code in
> this event: all rows will change, not just the current row.
>
> Instead, use Condtional Formatting.
> (This assumes Access 2000 or later.)
>
> Open the form in design view.
> Select the text box that should change color.
> Choose Conditional Formatting on the Format menu.
> Set Condition 1 to:
> Expression ([MyBoolean])
> and click the red text.
> Use the name of your boolean field instead of MyBoolean.
>
> (Note that True is -1 rather than 1 if you are talking about a yes/no field
> in an Access table.)
>
> --
> 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.
>
> "Domac" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >
> > I would like to set foreground color of textbox on subform depending on
> > value of booleann field.
> > Problem is that i can't catch event Detail_format that i used when doing
> > same task on report.
> >
> > If value is 1 then color of textbox is red if it is 0 then color is black.
> >
> > Subform is in continuos form view and I can't get detail_format event !!??
> >
> > Please help!
> > Domagoj


 
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
conditional detail format Mark Kubicki Microsoft Access Reports 2 28th Oct 2009 07:02 PM
Conditional format detail Jake F Microsoft Access Forms 4 16th Sep 2009 07:39 PM
Detail Format Not Firing jelybeans Microsoft Access VBA Modules 3 23rd Jul 2009 11:57 PM
Format Detail Section Stan Leeds Microsoft Access Reports 1 3rd May 2008 04:28 AM
Conditional Format for first detail only =?Utf-8?B?c21jY2Fydmk=?= Microsoft Access Reports 4 21st Sep 2006 09:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:35 AM.