Change Group Name

W

Widemonk

Ive seen this on another thread but couldnt grasp it.

I have a simple report that puts each record in one of two groups, depending
if a tick box is true or false. Now, instead of my group titles being 'True'
and 'False', I want a proper description.

The first control is a text box with ControlSource set to the right field
but I understand I also need a seperate control (text box or label ??), but
thats about as far as I've got.

Thanks in advance
 
D

Duane Hookom

If I understand correctly, you have a yes/no field that you would like to
display as "Value A" when True/Yes and "Value B" when False/No. If so, try
an expression like:
=IIf([YesNoField] = True, "Value A", "Value B")
Make sure the name of the control is not also the name of a field.
 
W

Widemonk

Im sure i was trying that before... but its worked now. Thanks Duane

Duane Hookom said:
If I understand correctly, you have a yes/no field that you would like to
display as "Value A" when True/Yes and "Value B" when False/No. If so, try
an expression like:
=IIf([YesNoField] = True, "Value A", "Value B")
Make sure the name of the control is not also the name of a field.

--
Duane Hookom
MS Access MVP
--

Widemonk said:
Ive seen this on another thread but couldnt grasp it.

I have a simple report that puts each record in one of two groups,
depending
if a tick box is true or false. Now, instead of my group titles being
'True'
and 'False', I want a proper description.

The first control is a text box with ControlSource set to the right field
but I understand I also need a seperate control (text box or label ??),
but
thats about as far as I've got.

Thanks in advance
 
R

robin

Duane,

I have this same situation, but I have multiple group headings (mere than
just a true/false situation.

I have group headings that are pulling

REFEN
REFGD
REFOT

and I want them to appear as:

Endodontic
General
Orthodontic

I feel I should be using an IIF like you had earlier in this post:

=IIf([YesNoField] = True, "Value A", "Value B")

But revised something like:

=IIf([BKCM_ACCL_CLASS] = REFEN , "Endodontic"; REFGD, "General"; REFOT,
"Orthodontic")

but this didn't work for me. Can you help me with syntax?

This is what would go in the control source of an unbound text box right?

Thanks
Robin
Access 2003


Duane Hookom said:
If I understand correctly, you have a yes/no field that you would like to
display as "Value A" when True/Yes and "Value B" when False/No. If so, try
an expression like:
=IIf([YesNoField] = True, "Value A", "Value B")
Make sure the name of the control is not also the name of a field.

--
Duane Hookom
MS Access MVP
--

Widemonk said:
Ive seen this on another thread but couldnt grasp it.

I have a simple report that puts each record in one of two groups,
depending
if a tick box is true or false. Now, instead of my group titles being
'True'
and 'False', I want a proper description.

The first control is a text box with ControlSource set to the right field
but I understand I also need a seperate control (text box or label ??),
but
thats about as far as I've got.

Thanks in advance
 
D

Duane Hookom

You really shouldn't use an expression in this instance. I would create a
small lookup table with two fields and values like:
REFEN Endocontic
REFGD General
REFOT Orthodontic

Include this table in your report's record source and join the "code"
fields. Drop the description field into the grid so you can use it in the
report.
--
Duane Hookom
MS Access MVP
--

robin said:
Duane,

I have this same situation, but I have multiple group headings (mere than
just a true/false situation.

I have group headings that are pulling

REFEN
REFGD
REFOT

and I want them to appear as:

Endodontic
General
Orthodontic

I feel I should be using an IIF like you had earlier in this post:

=IIf([YesNoField] = True, "Value A", "Value B")

But revised something like:

=IIf([BKCM_ACCL_CLASS] = REFEN , "Endodontic"; REFGD, "General"; REFOT,
"Orthodontic")

but this didn't work for me. Can you help me with syntax?

This is what would go in the control source of an unbound text box right?

Thanks
Robin
Access 2003


Duane Hookom said:
If I understand correctly, you have a yes/no field that you would like to
display as "Value A" when True/Yes and "Value B" when False/No. If so,
try
an expression like:
=IIf([YesNoField] = True, "Value A", "Value B")
Make sure the name of the control is not also the name of a field.

--
Duane Hookom
MS Access MVP
--

Widemonk said:
Ive seen this on another thread but couldnt grasp it.

I have a simple report that puts each record in one of two groups,
depending
if a tick box is true or false. Now, instead of my group titles being
'True'
and 'False', I want a proper description.

The first control is a text box with ControlSource set to the right
field
but I understand I also need a seperate control (text box or label ??),
but
thats about as far as I've got.

Thanks in advance
 
R

robin

Duane,

I am using a 'database connection manager' program to connect to my
company's tables through access, and I can't modify their tables.

Can I add a lookup table to a query?

Thanks,
Robin

Duane Hookom said:
You really shouldn't use an expression in this instance. I would create a
small lookup table with two fields and values like:
REFEN Endocontic
REFGD General
REFOT Orthodontic

Include this table in your report's record source and join the "code"
fields. Drop the description field into the grid so you can use it in the
report.
--
Duane Hookom
MS Access MVP
--

robin said:
Duane,

I have this same situation, but I have multiple group headings (mere than
just a true/false situation.

I have group headings that are pulling

REFEN
REFGD
REFOT

and I want them to appear as:

Endodontic
General
Orthodontic

I feel I should be using an IIF like you had earlier in this post:

=IIf([YesNoField] = True, "Value A", "Value B")

But revised something like:

=IIf([BKCM_ACCL_CLASS] = REFEN , "Endodontic"; REFGD, "General"; REFOT,
"Orthodontic")

but this didn't work for me. Can you help me with syntax?

This is what would go in the control source of an unbound text box right?

Thanks
Robin
Access 2003


Duane Hookom said:
If I understand correctly, you have a yes/no field that you would like to
display as "Value A" when True/Yes and "Value B" when False/No. If so,
try
an expression like:
=IIf([YesNoField] = True, "Value A", "Value B")
Make sure the name of the control is not also the name of a field.

--
Duane Hookom
MS Access MVP
--

Ive seen this on another thread but couldnt grasp it.

I have a simple report that puts each record in one of two groups,
depending
if a tick box is true or false. Now, instead of my group titles being
'True'
and 'False', I want a proper description.

The first control is a text box with ControlSource set to the right
field
but I understand I also need a seperate control (text box or label ??),
but
thats about as far as I've got.

Thanks in advance
 
D

Duane Hookom

If you can't create any tables and don't have one already built, you can
create a user-defined function:

Public Function GetREFTitle(strRef as String) as String
Select Case strRef
Case "REFEN"
GetREFTitle = "Endocontic"
Case "REFGD"
GetREFTitle = "General"
Case "REFOT"
GetREFTitle = "Orthodontic"
Case Else
GetREFTitle = "Huh?"
End Select
End Function

Add the above function to any standard module and save the module with a
name like: "basLookups"

Then in you query use:
RefTitle: GetREFTitle([BKCM_ACCL_CLASS])

You can also add a text box in a form or report with a control source of
=GetREFTitle([BKCM_ACCL_CLASS])

It is best to maintain all these lookups in a table. If that is not
possible, create a small function so the lookups are maintained only in one
place in your application. If you can't do that, go back to the table.
--
Duane Hookom
MS Access MVP
--

robin said:
Duane,

I am using a 'database connection manager' program to connect to my
company's tables through access, and I can't modify their tables.

Can I add a lookup table to a query?

Thanks,
Robin

Duane Hookom said:
You really shouldn't use an expression in this instance. I would create a
small lookup table with two fields and values like:
REFEN Endocontic
REFGD General
REFOT Orthodontic

Include this table in your report's record source and join the "code"
fields. Drop the description field into the grid so you can use it in the
report.
--
Duane Hookom
MS Access MVP
--

robin said:
Duane,

I have this same situation, but I have multiple group headings (mere
than
just a true/false situation.

I have group headings that are pulling

REFEN
REFGD
REFOT

and I want them to appear as:

Endodontic
General
Orthodontic

I feel I should be using an IIF like you had earlier in this post:

=IIf([YesNoField] = True, "Value A", "Value B")

But revised something like:

=IIf([BKCM_ACCL_CLASS] = REFEN , "Endodontic"; REFGD, "General"; REFOT,
"Orthodontic")

but this didn't work for me. Can you help me with syntax?

This is what would go in the control source of an unbound text box
right?

Thanks
Robin
Access 2003


:

If I understand correctly, you have a yes/no field that you would like
to
display as "Value A" when True/Yes and "Value B" when False/No. If so,
try
an expression like:
=IIf([YesNoField] = True, "Value A", "Value B")
Make sure the name of the control is not also the name of a field.

--
Duane Hookom
MS Access MVP
--

Ive seen this on another thread but couldnt grasp it.

I have a simple report that puts each record in one of two groups,
depending
if a tick box is true or false. Now, instead of my group titles
being
'True'
and 'False', I want a proper description.

The first control is a text box with ControlSource set to the right
field
but I understand I also need a seperate control (text box or label
??),
but
thats about as far as I've got.

Thanks in advance
 
R

robin

Duane - You Rock! Thank you.

Duane Hookom said:
If you can't create any tables and don't have one already built, you can
create a user-defined function:

Public Function GetREFTitle(strRef as String) as String
Select Case strRef
Case "REFEN"
GetREFTitle = "Endocontic"
Case "REFGD"
GetREFTitle = "General"
Case "REFOT"
GetREFTitle = "Orthodontic"
Case Else
GetREFTitle = "Huh?"
End Select
End Function

Add the above function to any standard module and save the module with a
name like: "basLookups"

Then in you query use:
RefTitle: GetREFTitle([BKCM_ACCL_CLASS])

You can also add a text box in a form or report with a control source of
=GetREFTitle([BKCM_ACCL_CLASS])

It is best to maintain all these lookups in a table. If that is not
possible, create a small function so the lookups are maintained only in one
place in your application. If you can't do that, go back to the table.
--
Duane Hookom
MS Access MVP
--

robin said:
Duane,

I am using a 'database connection manager' program to connect to my
company's tables through access, and I can't modify their tables.

Can I add a lookup table to a query?

Thanks,
Robin

Duane Hookom said:
You really shouldn't use an expression in this instance. I would create a
small lookup table with two fields and values like:
REFEN Endocontic
REFGD General
REFOT Orthodontic

Include this table in your report's record source and join the "code"
fields. Drop the description field into the grid so you can use it in the
report.
--
Duane Hookom
MS Access MVP
--

Duane,

I have this same situation, but I have multiple group headings (mere
than
just a true/false situation.

I have group headings that are pulling

REFEN
REFGD
REFOT

and I want them to appear as:

Endodontic
General
Orthodontic

I feel I should be using an IIF like you had earlier in this post:

=IIf([YesNoField] = True, "Value A", "Value B")

But revised something like:

=IIf([BKCM_ACCL_CLASS] = REFEN , "Endodontic"; REFGD, "General"; REFOT,
"Orthodontic")

but this didn't work for me. Can you help me with syntax?

This is what would go in the control source of an unbound text box
right?

Thanks
Robin
Access 2003


:

If I understand correctly, you have a yes/no field that you would like
to
display as "Value A" when True/Yes and "Value B" when False/No. If so,
try
an expression like:
=IIf([YesNoField] = True, "Value A", "Value B")
Make sure the name of the control is not also the name of a field.

--
Duane Hookom
MS Access MVP
--

Ive seen this on another thread but couldnt grasp it.

I have a simple report that puts each record in one of two groups,
depending
if a tick box is true or false. Now, instead of my group titles
being
'True'
and 'False', I want a proper description.

The first control is a text box with ControlSource set to the right
field
but I understand I also need a seperate control (text box or label
??),
but
thats about as far as I've got.

Thanks in advance
 
Top