Yes No question

Yes No question

am 27.11.2007 20:10:54 von Jan Hansen

I need some help, and im not very good at this.

I have a Yes/No field and i need to make access 2003 write DONE i a tekst
field when Yes in the Yes/No field is set (-1). I know it is in the code
window (VBA) it is done, but not how.

Please help me.

Jan Hansen, Denmark

Re: Yes No question

am 27.11.2007 20:32:12 von Salad

Jan Hansen wrote:

> I need some help, and im not very good at this.
>
> I have a Yes/No field and i need to make access 2003 write DONE i a tekst
> field when Yes in the Yes/No field is set (-1). I know it is in the code
> window (VBA) it is done, but not how.
>
> Please help me.
>
> Jan Hansen, Denmark
>
>
If your text box is called Text0 to display something and the YesNo
field is called YN, you could make the control source (data tab in
properties for Text0)
=IIF([YN],"Done","Incomplete")
or
=IIF([YN],"Done","")
to keep the field blank if false.

Re: Yes No question

am 27.11.2007 21:10:14 von Davidb

On Nov 27, 2:10 pm, "Jan Hansen" AT)privat.dk> wrote:
> I need some help, and im not very good at this.
>
> I have a Yes/No field and i need to make access 2003 write DONE i a tekst
> field when Yes in the Yes/No field is set (-1). I know it is in the code
> window (VBA) it is done, but not how.
>
> Please help me.
>
> Jan Hansen, Denmark

Where are you attempting to update this TEXT (not tekst) field? Is it
on a form for example? Do you want the TEXT field to be updated as
you change the value of the Yes/No field or is this simply a display
only field? Give us more info on what it is you are doing...

Re: Yes No question

am 27.11.2007 21:47:21 von Jan Hansen

"DavidB" skrev i en meddelelse
news:c3f82931-ed27-4688-882f-124266c721a5@r60g2000hsc.google groups.com...
> On Nov 27, 2:10 pm, "Jan Hansen" > AT)privat.dk> wrote:
>> I need some help, and im not very good at this.
>>
>> I have a Yes/No field and i need to make access 2003 write DONE i a tekst
>> field when Yes in the Yes/No field is set (-1). I know it is in the code
>> window (VBA) it is done, but not how.
>>
>> Please help me.
>>
>> Jan Hansen, Denmark
>
> Where are you attempting to update this TEXT (not tekst) field? Is it
> on a form for example? Do you want the TEXT field to be updated as
> you change the value of the Yes/No field or is this simply a display
> only field? Give us more info on what it is you are doing...

Hmm this is dificult in english, but i will try.

The above was only an example, this is the case.

I got at database where i write jobs fore my crew.
And the Yes/No field is to set urgent on some of the jobs.
And i want the urgent jobs to have a yellow background on the repport i
print out.
And i know how to get yellow background by conditional formatting but that
require a specific tekst or value in the field.
That was why i wanted the field to get the tekst "Urgent" så i could use
that as a condition.
In short. Yes in the Yes/No field makes my Urgent field write "Urgent". And
it is only on the printed report i want the yellow background.

I hope it makes sence. And im sorry for my bad english.

Re: Yes No question

am 28.11.2007 17:26:10 von Jan Hansen

"Jan Hansen" skrev i en
meddelelse news:474c81a5$0$15901$edfadb0f@dtext01.news.tele.dk...
>
> "DavidB" skrev i en meddelelse
> news:c3f82931-ed27-4688-882f-124266c721a5@r60g2000hsc.google groups.com...
>> On Nov 27, 2:10 pm, "Jan Hansen" >> AT)privat.dk> wrote:
>>> I need some help, and im not very good at this.
>>>
>>> I have a Yes/No field and i need to make access 2003 write DONE i a
>>> tekst
>>> field when Yes in the Yes/No field is set (-1). I know it is in the code
>>> window (VBA) it is done, but not how.
>>>
>>> Please help me.
>>>
>>> Jan Hansen, Denmark
>>
>> Where are you attempting to update this TEXT (not tekst) field? Is it
>> on a form for example? Do you want the TEXT field to be updated as
>> you change the value of the Yes/No field or is this simply a display
>> only field? Give us more info on what it is you are doing...
>
> Hmm this is dificult in english, but i will try.
>
> The above was only an example, this is the case.
>
> I got at database where i write jobs fore my crew.
> And the Yes/No field is to set urgent on some of the jobs.
> And i want the urgent jobs to have a yellow background on the repport i
> print out.
> And i know how to get yellow background by conditional formatting but that
> require a specific tekst or value in the field.
> That was why i wanted the field to get the tekst "Urgent" så i could use
> that as a condition.
> In short. Yes in the Yes/No field makes my Urgent field write "Urgent".
> And it is only on the printed report i want the yellow background.
>
> I hope it makes sence. And im sorry for my bad english.

No help on this ?

Re: Yes No question

am 28.11.2007 17:41:46 von Salad

Jan Hansen wrote:
> "Jan Hansen" skrev i en
> meddelelse news:474c81a5$0$15901$edfadb0f@dtext01.news.tele.dk...
>
>>"DavidB" skrev i en meddelelse
>>news:c3f82931-ed27-4688-882f-124266c721a5@r60g2000hsc.goog legroups.com...
>>
>>>On Nov 27, 2:10 pm, "Jan Hansen" >>>AT)privat.dk> wrote:
>>>
>>>>I need some help, and im not very good at this.
>>>>
>>>>I have a Yes/No field and i need to make access 2003 write DONE i a
>>>>tekst
>>>>field when Yes in the Yes/No field is set (-1). I know it is in the code
>>>>window (VBA) it is done, but not how.
>>>>
>>>>Please help me.
>>>>
>>>>Jan Hansen, Denmark
>>>
>>>Where are you attempting to update this TEXT (not tekst) field? Is it
>>>on a form for example? Do you want the TEXT field to be updated as
>>>you change the value of the Yes/No field or is this simply a display
>>>only field? Give us more info on what it is you are doing...
>>
>>Hmm this is dificult in english, but i will try.
>>
>>The above was only an example, this is the case.
>>
>>I got at database where i write jobs fore my crew.
>>And the Yes/No field is to set urgent on some of the jobs.
>>And i want the urgent jobs to have a yellow background on the repport i
>>print out.
>>And i know how to get yellow background by conditional formatting but that
>>require a specific tekst or value in the field.
>>That was why i wanted the field to get the tekst "Urgent" så i could use
>>that as a condition.
>>In short. Yes in the Yes/No field makes my Urgent field write "Urgent".
>>And it is only on the printed report i want the yellow background.
>>
>>I hope it makes sence. And im sorry for my bad english.
>
>
> No help on this ?
>

I would drop the YesNo field (I'll call it YN) in the report and make
it's visible property False. I would create a textbox (I'll call it
YNDescription. In it's control source (under data tab in Property
Sheet) enter
=IIF([YN],"Urgent","")

You could even display or not display the field. Let's say the YN field
in in the Detail band. Make it invisible. Put in a label that says
"Urgent". Give the label the name UrgentLabel. Put a yellow background
in it. Now in the Format event of the Detail band enter
Me.UrgentLabel.Visible = Me.YN

Re: Yes No question

am 28.11.2007 20:44:09 von Davidb

On Nov 28, 11:41 am, Salad wrote:
> Jan Hansen wrote:
> > "Jan Hansen" skrev i en
> > meddelelsenews:474c81a5$0$15901$edfadb0f@dtext01.news.tele.d k...
>
> >>"DavidB" skrev i en meddelelse
> >>news:c3f82931-ed27-4688-882f-124266c721a5@r60g2000hsc.goog legroups.com..=
..
>
> >>>On Nov 27, 2:10 pm, "Jan Hansen" > >>>AT)privat.dk> wrote:
>
> >>>>I need some help, and im not very good at this.
>
> >>>>I have a Yes/No field and i need to make access 2003 write DONE i a
> >>>>tekst
> >>>>field when Yes in the Yes/No field is set (-1). I know it is in the co=
de
> >>>>window (VBA) it is done, but not how.
>
> >>>>Please help me.
>
> >>>>Jan Hansen, Denmark
>
> >>>Where are you attempting to update this TEXT (not tekst) field? Is it
> >>>on a form for example? Do you want the TEXT field to be updated as
> >>>you change the value of the Yes/No field or is this simply a display
> >>>only field? Give us more info on what it is you are doing...
>
> >>Hmm this is dificult in english, but i will try.
>
> >>The above was only an example, this is the case.
>
> >>I got at database where i write jobs fore my crew.
> >>And the Yes/No field is to set urgent on some of the jobs.
> >>And i want the urgent jobs to have a yellow background on the repport i
> >>print out.
> >>And i know how to get yellow background by conditional formatting but th=
at
> >>require a specific tekst or value in the field.
> >>That was why i wanted the field to get the tekst "Urgent" s=E5 i could u=
se
> >>that as a condition.
> >>In short. Yes in the Yes/No field makes my Urgent field write "Urgent".
> >>And it is only on the printed report i want the yellow background.
>
> >>I hope it makes sence. And im sorry for my bad english.
>
> > No help on this ?
>
> I would drop the YesNo field (I'll call it YN) in the report and make
> it's visible property False. I would create a textbox (I'll call it
> YNDescription. In it's control source (under data tab in Property
> Sheet) enter
> =3DIIF([YN],"Urgent","")
>
> You could even display or not display the field. Let's say the YN field
> in in the Detail band. Make it invisible. Put in a label that says
> "Urgent". Give the label the name UrgentLabel. Put a yellow background
> in it. Now in the Format event of the Detail band enter
> Me.UrgentLabel.Visible =3D Me.YN- Hide quoted text -
>
> - Show quoted text -

In the Query that pulls the data for your report add a field such as
this...

ASSUME THE Y/N FIELD IS NAMED "Urgent". SUBSTITUE THE APPROPRAITE
FIELD NAME.

JobStatus: iif([Urgent]=3DTrue,"Urgent","")

Then drop the JobStatus field in the report. It will have the text
"Urgent" for all jobs with the Y/N field =3D Y and it will have the text
"" (an empty string) for all the Y/N field =3D N. You can then apply
yoru conditional formatting. No need to hide/unhide anything or code
anything additional.

Re: Yes No question

am 29.11.2007 21:36:54 von Jan Hansen

"DavidB" skrev i en meddelelse
news:836c0b53-e49b-4f5c-9916-3c72d2e272dc@s12g2000prg.google groups.com...
On Nov 28, 11:41 am, Salad wrote:
> Jan Hansen wrote:
> > "Jan Hansen" skrev i en
> > meddelelsenews:474c81a5$0$15901$edfadb0f@dtext01.news.tele.d k...
>
> >>"DavidB" skrev i en meddelelse
> >>news:c3f82931-ed27-4688-882f-124266c721a5@r60g2000hsc.goog legroups.com...
>
> >>>On Nov 27, 2:10 pm, "Jan Hansen" > >>>AT)privat.dk> wrote:
>
> >>>>I need some help, and im not very good at this.
>
> >>>>I have a Yes/No field and i need to make access 2003 write DONE i a
> >>>>tekst
> >>>>field when Yes in the Yes/No field is set (-1). I know it is in the
> >>>>code
> >>>>window (VBA) it is done, but not how.
>
> >>>>Please help me.
>
> >>>>Jan Hansen, Denmark
>
> >>>Where are you attempting to update this TEXT (not tekst) field? Is it
> >>>on a form for example? Do you want the TEXT field to be updated as
> >>>you change the value of the Yes/No field or is this simply a display
> >>>only field? Give us more info on what it is you are doing...
>
> >>Hmm this is dificult in english, but i will try.
>
> >>The above was only an example, this is the case.
>
> >>I got at database where i write jobs fore my crew.
> >>And the Yes/No field is to set urgent on some of the jobs.
> >>And i want the urgent jobs to have a yellow background on the repport i
> >>print out.
> >>And i know how to get yellow background by conditional formatting but
> >>that
> >>require a specific tekst or value in the field.
> >>That was why i wanted the field to get the tekst "Urgent" så i could use
> >>that as a condition.
> >>In short. Yes in the Yes/No field makes my Urgent field write "Urgent".
> >>And it is only on the printed report i want the yellow background.
>
> >>I hope it makes sence. And im sorry for my bad english.
>
> > No help on this ?
>
>> I would drop the YesNo field (I'll call it YN) in the report and make
>> it's visible property False. I would create a textbox (I'll call it
>> YNDescription. In it's control source (under data tab in Property
>>Sheet) enter
>> =IIF([YN],"Urgent","")
>>
>> You could even display or not display the field. Let's say the YN field
>> in in the Detail band. Make it invisible. Put in a label that says
>> "Urgent". Give the label the name UrgentLabel. Put a yellow background
>> in it. Now in the Format event of the Detail band enter
>> Me.UrgentLabel.Visible = Me.YN- Hide quoted text -
>>
>> - Show quoted text -
>
>In the Query that pulls the data for your report add a field such as
>
>ASSUME THE Y/N FIELD IS NAMED "Urgent". SUBSTITUE THE APPROPRAITE
>FIELD NAME.
>
>JobStatus: iif([Urgent]=True,"Urgent","")
>
>Then drop the JobStatus field in the report. It will have the text
>"Urgent" for all jobs with the Y/N field = Y and it will have the text
>"" (an empty string) for all the Y/N field = N. You can then apply
>yoru conditional formatting. No need to hide/unhide anything or code
>anything additional.

I'm sorry but i don't get it right.

Every time i try i get an error. I'm not even sure where to put it in.

I have tryed in Quary and Reports and both places with errors.
Could i get some of you to guide me step by step. And remember i'm new to
this.

Re: Yes No question

am 30.11.2007 15:34:06 von Salad

Jan Hansen wrote:

> "DavidB" skrev i en meddelelse
> news:836c0b53-e49b-4f5c-9916-3c72d2e272dc@s12g2000prg.google groups.com...
> On Nov 28, 11:41 am, Salad wrote:
>
>>Jan Hansen wrote:
>>
>>>"Jan Hansen" skrev i en
>>>meddelelsenews:474c81a5$0$15901$edfadb0f@dtext01.news.tel e.dk...
>>
>>>>"DavidB" skrev i en meddelelse
>>>>news:c3f82931-ed27-4688-882f-124266c721a5@r60g2000hsc.go oglegroups.com...
>>
>>>>>On Nov 27, 2:10 pm, "Jan Hansen" >>>>>AT)privat.dk> wrote:
>>
>>>>>>I need some help, and im not very good at this.
>>
>>>>>>I have a Yes/No field and i need to make access 2003 write DONE i a
>>>>>>tekst
>>>>>>field when Yes in the Yes/No field is set (-1). I know it is in the
>>>>>>code
>>>>>>window (VBA) it is done, but not how.
>>
>>>>>>Please help me.
>>
>>>>>>Jan Hansen, Denmark
>>
>>>>>Where are you attempting to update this TEXT (not tekst) field? Is it
>>>>>on a form for example? Do you want the TEXT field to be updated as
>>>>>you change the value of the Yes/No field or is this simply a display
>>>>>only field? Give us more info on what it is you are doing...
>>
>>>>Hmm this is dificult in english, but i will try.
>>
>>>>The above was only an example, this is the case.
>>
>>>>I got at database where i write jobs fore my crew.
>>>>And the Yes/No field is to set urgent on some of the jobs.
>>>>And i want the urgent jobs to have a yellow background on the repport i
>>>>print out.
>>>>And i know how to get yellow background by conditional formatting but
>>>>that
>>>>require a specific tekst or value in the field.
>>>>That was why i wanted the field to get the tekst "Urgent" så i could use
>>>>that as a condition.
>>>>In short. Yes in the Yes/No field makes my Urgent field write "Urgent".
>>>>And it is only on the printed report i want the yellow background.
>>
>>>>I hope it makes sence. And im sorry for my bad english.
>>
>>>No help on this ?
>>
>>>I would drop the YesNo field (I'll call it YN) in the report and make
>>>it's visible property False. I would create a textbox (I'll call it
>>>YNDescription. In it's control source (under data tab in Property
>>>Sheet) enter
>>> =IIF([YN],"Urgent","")
>>>
>>>You could even display or not display the field. Let's say the YN field
>>>in in the Detail band. Make it invisible. Put in a label that says
>>>"Urgent". Give the label the name UrgentLabel. Put a yellow background
>>>in it. Now in the Format event of the Detail band enter
>>> Me.UrgentLabel.Visible = Me.YN- Hide quoted text -
>>>
>>>- Show quoted text -
>>
>>In the Query that pulls the data for your report add a field such as
>
> >
>>ASSUME THE Y/N FIELD IS NAMED "Urgent". SUBSTITUE THE APPROPRAITE
>>FIELD NAME.
>>
>>JobStatus: iif([Urgent]=True,"Urgent","")
>>
>>Then drop the JobStatus field in the report. It will have the text
>>"Urgent" for all jobs with the Y/N field = Y and it will have the text
>>"" (an empty string) for all the Y/N field = N. You can then apply
>>yoru conditional formatting. No need to hide/unhide anything or code
>>anything additional.
>
>
> I'm sorry but i don't get it right.
>
> Every time i try i get an error. I'm not even sure where to put it in.
>
> I have tryed in Quary and Reports and both places with errors.
> Could i get some of you to guide me step by step. And remember i'm new to
> this.
>

I think the point was you can already have a value for that field inside
the Reports recordsource.

Let's say the Reports recordsource was
Select ID, FirstName, LastName, YN From Table1

You can create/add a column to the SQL Statement/Recordsource. You can
create that new column with the syntax:
NewColumnName : Value
You separate the column name from the value with a :

So you could have something like
Urgent : IIF([YN],"Urgent","")

If you were to look at the new SQL statement (View/SQL from the menu),
with Urgent field, it'd would look something like this
Select ID, FirstName, LastName, IIF([YN],"Urgent","") As Urgent From
Table1

Now open the report in design mode and from the field list on the
toolbar select the field Urgent and drag it onto your Report. Done. No
programming, simply adding a column to the recordsource.

Re: Yes No question

am 05.12.2007 19:49:19 von Jan Hansen

Damn, how blind can a man be.

Thanks for the help everybody. It works fine.