Combobox help

G

Guest

Hi - really stuck on this one - a newbie and can 'do code' if everything is
supplied.

I want the following THREE options to be available from the combobox [and am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " & CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
K

Ken Snell [MVP]

It's not clear what you want here. Do you want all three options to show as
values in each row? Or do you want to show the three "options" exactly as
you've posted (which I admit would not seem to make sense)? Or do you want
the ability to let the user select which option to show? Or do you want a
single value to show that will not have "blank or extra spaces" if a value
doesn't exist in one or more of the fields?
 
G

Guest

Hi Ken - I want ALL THREE options to display in the combobox as THREE
separate lines, and then I want the user to select ONE of the three options .
[The options are for 'declaring' WHO donated funds. ie - was it the couple
[parents], or as individuals [in the case of separated parents]. This is a
student fundraising db.
--
Sue Compelling


Ken Snell said:
It's not clear what you want here. Do you want all three options to show as
values in each row? Or do you want to show the three "options" exactly as
you've posted (which I admit would not seem to make sense)? Or do you want
the ability to let the user select which option to show? Or do you want a
single value to show that will not have "blank or extra spaces" if a value
doesn't exist in one or more of the fields?

--

Ken Snell
<MS ACCESS MVP>

Sue Compelling said:
Hi - really stuck on this one - a newbie and can 'do code' if everything
is
supplied.

I want the following THREE options to be available from the combobox [and
am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
K

Ken Snell [MVP]

If you just want to use text for what you show, you can set the Row Source
Type to a Value List, then put text strings (separated by semicolons) as the
values to show.

Are you wanting to show the exact strings that you posted? What will you do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

Sue Compelling said:
Hi Ken - I want ALL THREE options to display in the combobox as THREE
separate lines, and then I want the user to select ONE of the three
options .
[The options are for 'declaring' WHO donated funds. ie - was it the
couple
[parents], or as individuals [in the case of separated parents]. This is
a
student fundraising db.
--
Sue Compelling


Ken Snell said:
It's not clear what you want here. Do you want all three options to show
as
values in each row? Or do you want to show the three "options" exactly as
you've posted (which I admit would not seem to make sense)? Or do you
want
the ability to let the user select which option to show? Or do you want a
single value to show that will not have "blank or extra spaces" if a
value
doesn't exist in one or more of the fields?

--

Ken Snell
<MS ACCESS MVP>

message
Hi - really stuck on this one - a newbie and can 'do code' if
everything
is
supplied.

I want the following THREE options to be available from the combobox
[and
am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
G

Guest

Hi Ken

Yes - I want the exact strings as per my original post. IF there is NO
second caregiver I'm OK if the combo box only returns a "&" [as per the
expression]. These values wiill be stored in the Donations Table - in the
DonatedBy field - so we can get a sense of the recency and value of donations.

--
Sue Compelling


Ken Snell said:
If you just want to use text for what you show, you can set the Row Source
Type to a Value List, then put text strings (separated by semicolons) as the
values to show.

Are you wanting to show the exact strings that you posted? What will you do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

Sue Compelling said:
Hi Ken - I want ALL THREE options to display in the combobox as THREE
separate lines, and then I want the user to select ONE of the three
options .
[The options are for 'declaring' WHO donated funds. ie - was it the
couple
[parents], or as individuals [in the case of separated parents]. This is
a
student fundraising db.
--
Sue Compelling


Ken Snell said:
It's not clear what you want here. Do you want all three options to show
as
values in each row? Or do you want to show the three "options" exactly as
you've posted (which I admit would not seem to make sense)? Or do you
want
the ability to let the user select which option to show? Or do you want a
single value to show that will not have "blank or extra spaces" if a
value
doesn't exist in one or more of the fields?

--

Ken Snell
<MS ACCESS MVP>

message
Hi - really stuck on this one - a newbie and can 'do code' if
everything
is
supplied.

I want the following THREE options to be available from the combobox
[and
am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
K

Ken Snell [MVP]

In that case, probably the easiest thing to do is to create a table (name it
tblStrings) with two fields in it (fldOrder [number Long] and fldString
[text 255]). Make fldOrder the primary key.

Then put each string into a record and put a number in the fldOrder field to
allow the strings to sort in the desired order.

Then use this query as the Row Source for that combo box:

SELECT fldString FROM tblStrings ORDER BY fldOrder ASC;

--

Ken Snell
<MS ACCESS MVP>

Sue Compelling said:
Hi Ken

Yes - I want the exact strings as per my original post. IF there is NO
second caregiver I'm OK if the combo box only returns a "&" [as per the
expression]. These values wiill be stored in the Donations Table - in the
DonatedBy field - so we can get a sense of the recency and value of
donations.

--
Sue Compelling


Ken Snell said:
If you just want to use text for what you show, you can set the Row
Source
Type to a Value List, then put text strings (separated by semicolons) as
the
values to show.

Are you wanting to show the exact strings that you posted? What will you
do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken - I want ALL THREE options to display in the combobox as THREE
separate lines, and then I want the user to select ONE of the three
options .
[The options are for 'declaring' WHO donated funds. ie - was it the
couple
[parents], or as individuals [in the case of separated parents]. This
is
a
student fundraising db.
--
Sue Compelling


:

It's not clear what you want here. Do you want all three options to
show
as
values in each row? Or do you want to show the three "options" exactly
as
you've posted (which I admit would not seem to make sense)? Or do you
want
the ability to let the user select which option to show? Or do you
want a
single value to show that will not have "blank or extra spaces" if a
value
doesn't exist in one or more of the fields?

--

Ken Snell
<MS ACCESS MVP>

message
Hi - really stuck on this one - a newbie and can 'do code' if
everything
is
supplied.

I want the following THREE options to be available from the combobox
[and
am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
G

Guest

Hi Ken -

Thanks for persevering. Did exactly as you described, however, when I go to
the drop down it is simply a blank box.

[Is the fact that the combo box sits in a subform on a TabControlPage making
this impossible?]
--
Sue Compelling


Ken Snell said:
In that case, probably the easiest thing to do is to create a table (name it
tblStrings) with two fields in it (fldOrder [number Long] and fldString
[text 255]). Make fldOrder the primary key.

Then put each string into a record and put a number in the fldOrder field to
allow the strings to sort in the desired order.

Then use this query as the Row Source for that combo box:

SELECT fldString FROM tblStrings ORDER BY fldOrder ASC;

--

Ken Snell
<MS ACCESS MVP>

Sue Compelling said:
Hi Ken

Yes - I want the exact strings as per my original post. IF there is NO
second caregiver I'm OK if the combo box only returns a "&" [as per the
expression]. These values wiill be stored in the Donations Table - in the
DonatedBy field - so we can get a sense of the recency and value of
donations.

--
Sue Compelling


Ken Snell said:
If you just want to use text for what you show, you can set the Row
Source
Type to a Value List, then put text strings (separated by semicolons) as
the
values to show.

Are you wanting to show the exact strings that you posted? What will you
do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken - I want ALL THREE options to display in the combobox as THREE
separate lines, and then I want the user to select ONE of the three
options .
[The options are for 'declaring' WHO donated funds. ie - was it the
couple
[parents], or as individuals [in the case of separated parents]. This
is
a
student fundraising db.
--
Sue Compelling


:

It's not clear what you want here. Do you want all three options to
show
as
values in each row? Or do you want to show the three "options" exactly
as
you've posted (which I admit would not seem to make sense)? Or do you
want
the ability to let the user select which option to show? Or do you
want a
single value to show that will not have "blank or extra spaces" if a
value
doesn't exist in one or more of the fields?

--

Ken Snell
<MS ACCESS MVP>

message
Hi - really stuck on this one - a newbie and can 'do code' if
everything
is
supplied.

I want the following THREE options to be available from the combobox
[and
am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
K

Ken Snell [MVP]

It works for me when I set this up. So there may be something incorrect
about your combobox.

Post here the values of all these properties for the combo box:

RowSourceType
RowSource
ColumnCount
ColumnWidths
BoundColumn
ControlSource
Format
--

Ken Snell
<MS ACCESS MVP>




Sue Compelling said:
Hi Ken -

Thanks for persevering. Did exactly as you described, however, when I go
to
the drop down it is simply a blank box.

[Is the fact that the combo box sits in a subform on a TabControlPage
making
this impossible?]
--
Sue Compelling


Ken Snell said:
In that case, probably the easiest thing to do is to create a table (name
it
tblStrings) with two fields in it (fldOrder [number Long] and fldString
[text 255]). Make fldOrder the primary key.

Then put each string into a record and put a number in the fldOrder field
to
allow the strings to sort in the desired order.

Then use this query as the Row Source for that combo box:

SELECT fldString FROM tblStrings ORDER BY fldOrder ASC;

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken

Yes - I want the exact strings as per my original post. IF there is NO
second caregiver I'm OK if the combo box only returns a "&" [as per the
expression]. These values wiill be stored in the Donations Table - in
the
DonatedBy field - so we can get a sense of the recency and value of
donations.

--
Sue Compelling


:

If you just want to use text for what you show, you can set the Row
Source
Type to a Value List, then put text strings (separated by semicolons)
as
the
values to show.

Are you wanting to show the exact strings that you posted? What will
you
do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken - I want ALL THREE options to display in the combobox as
THREE
separate lines, and then I want the user to select ONE of the three
options .
[The options are for 'declaring' WHO donated funds. ie - was it the
couple
[parents], or as individuals [in the case of separated parents].
This
is
a
student fundraising db.
--
Sue Compelling


:

It's not clear what you want here. Do you want all three options to
show
as
values in each row? Or do you want to show the three "options"
exactly
as
you've posted (which I admit would not seem to make sense)? Or do
you
want
the ability to let the user select which option to show? Or do you
want a
single value to show that will not have "blank or extra spaces" if
a
value
doesn't exist in one or more of the fields?

--

Ken Snell
<MS ACCESS MVP>

message
Hi - really stuck on this one - a newbie and can 'do code' if
everything
is
supplied.

I want the following THREE options to be available from the
combobox
[and
am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
G

Guest

Hi Ken .... thanks - see below [ummmm - I'm also a newbie, so some of this
may induce eye rolling]
--
Sue Compelling


Ken Snell said:
It works for me when I set this up. So there may be something incorrect
about your combobox.

Post here the values of all these properties for the combo box:

RowSourceType blank
RowSource SELECT fldString FROM tblStrings ORDER BY fldOrder ASC;
ColumnCount 1
ColumnWidths 5.053cm
BoundColumn 1
ControlSource DonatedBy
Format blank
--

Ken Snell
<MS ACCESS MVP>




Sue Compelling said:
Hi Ken -

Thanks for persevering. Did exactly as you described, however, when I go
to
the drop down it is simply a blank box.

[Is the fact that the combo box sits in a subform on a TabControlPage
making
this impossible?]
--
Sue Compelling


Ken Snell said:
In that case, probably the easiest thing to do is to create a table (name
it
tblStrings) with two fields in it (fldOrder [number Long] and fldString
[text 255]). Make fldOrder the primary key.

Then put each string into a record and put a number in the fldOrder field
to
allow the strings to sort in the desired order.

Then use this query as the Row Source for that combo box:

SELECT fldString FROM tblStrings ORDER BY fldOrder ASC;

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken

Yes - I want the exact strings as per my original post. IF there is NO
second caregiver I'm OK if the combo box only returns a "&" [as per the
expression]. These values wiill be stored in the Donations Table - in
the
DonatedBy field - so we can get a sense of the recency and value of
donations.

--
Sue Compelling


:

If you just want to use text for what you show, you can set the Row
Source
Type to a Value List, then put text strings (separated by semicolons)
as
the
values to show.

Are you wanting to show the exact strings that you posted? What will
you
do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken - I want ALL THREE options to display in the combobox as
THREE
separate lines, and then I want the user to select ONE of the three
options .
[The options are for 'declaring' WHO donated funds. ie - was it the
couple
[parents], or as individuals [in the case of separated parents].
This
is
a
student fundraising db.
--
Sue Compelling


:

It's not clear what you want here. Do you want all three options to
show
as
values in each row? Or do you want to show the three "options"
exactly
as
you've posted (which I admit would not seem to make sense)? Or do
you
want
the ability to let the user select which option to show? Or do you
want a
single value to show that will not have "blank or extra spaces" if
a
value
doesn't exist in one or more of the fields?

--

Ken Snell
<MS ACCESS MVP>

message
Hi - really stuck on this one - a newbie and can 'do code' if
everything
is
supplied.

I want the following THREE options to be available from the
combobox
[and
am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
K

Ken Snell [MVP]

Change the RowSourceType to "Table/Query".

--

Ken Snell
<MS ACCESS MVP>

Sue Compelling said:
Hi Ken .... thanks - see below [ummmm - I'm also a newbie, so some of this
may induce eye rolling]
--
Sue Compelling


Ken Snell said:
It works for me when I set this up. So there may be something incorrect
about your combobox.

Post here the values of all these properties for the combo box:

RowSourceType blank
RowSource SELECT fldString FROM tblStrings ORDER BY fldOrder
ASC;
ColumnCount 1
ColumnWidths 5.053cm
BoundColumn 1
ControlSource DonatedBy
Format blank
--

Ken Snell
<MS ACCESS MVP>




message
Hi Ken -

Thanks for persevering. Did exactly as you described, however, when I
go
to
the drop down it is simply a blank box.

[Is the fact that the combo box sits in a subform on a TabControlPage
making
this impossible?]
--
Sue Compelling


:

In that case, probably the easiest thing to do is to create a table
(name
it
tblStrings) with two fields in it (fldOrder [number Long] and
fldString
[text 255]). Make fldOrder the primary key.

Then put each string into a record and put a number in the fldOrder
field
to
allow the strings to sort in the desired order.

Then use this query as the Row Source for that combo box:

SELECT fldString FROM tblStrings ORDER BY fldOrder ASC;

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken

Yes - I want the exact strings as per my original post. IF there is
NO
second caregiver I'm OK if the combo box only returns a "&" [as per
the
expression]. These values wiill be stored in the Donations Table -
in
the
DonatedBy field - so we can get a sense of the recency and value of
donations.

--
Sue Compelling


:

If you just want to use text for what you show, you can set the Row
Source
Type to a Value List, then put text strings (separated by
semicolons)
as
the
values to show.

Are you wanting to show the exact strings that you posted? What
will
you
do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken - I want ALL THREE options to display in the combobox as
THREE
separate lines, and then I want the user to select ONE of the
three
options .
[The options are for 'declaring' WHO donated funds. ie - was it
the
couple
[parents], or as individuals [in the case of separated parents].
This
is
a
student fundraising db.
--
Sue Compelling


:

It's not clear what you want here. Do you want all three options
to
show
as
values in each row? Or do you want to show the three "options"
exactly
as
you've posted (which I admit would not seem to make sense)? Or
do
you
want
the ability to let the user select which option to show? Or do
you
want a
single value to show that will not have "blank or extra spaces"
if
a
value
doesn't exist in one or more of the fields?

--

Ken Snell
<MS ACCESS MVP>

in
message
Hi - really stuck on this one - a newbie and can 'do code' if
everything
is
supplied.

I want the following THREE options to be available from the
combobox
[and
am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " "
&
CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
G

Guest

Thanks again .... Now this does allow me to select from 3 OPTIONS though
those options are the expressions [as below] rather than the resulting names.
Any clues?

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " & CG2LastName
CG1FirstName & " " & CG1LastName
CG2FirstName & " " & CG2LastName
--
Sue Compelling


Ken Snell said:
Change the RowSourceType to "Table/Query".

--

Ken Snell
<MS ACCESS MVP>

Sue Compelling said:
Hi Ken .... thanks - see below [ummmm - I'm also a newbie, so some of this
may induce eye rolling]
--
Sue Compelling


Ken Snell said:
It works for me when I set this up. So there may be something incorrect
about your combobox.

Post here the values of all these properties for the combo box:

RowSourceType blank
RowSource SELECT fldString FROM tblStrings ORDER BY fldOrder
ASC;
ColumnCount 1
ColumnWidths 5.053cm
BoundColumn 1
ControlSource DonatedBy
Format blank
--

Ken Snell
<MS ACCESS MVP>




message
Hi Ken -

Thanks for persevering. Did exactly as you described, however, when I
go
to
the drop down it is simply a blank box.

[Is the fact that the combo box sits in a subform on a TabControlPage
making
this impossible?]
--
Sue Compelling


:

In that case, probably the easiest thing to do is to create a table
(name
it
tblStrings) with two fields in it (fldOrder [number Long] and
fldString
[text 255]). Make fldOrder the primary key.

Then put each string into a record and put a number in the fldOrder
field
to
allow the strings to sort in the desired order.

Then use this query as the Row Source for that combo box:

SELECT fldString FROM tblStrings ORDER BY fldOrder ASC;

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken

Yes - I want the exact strings as per my original post. IF there is
NO
second caregiver I'm OK if the combo box only returns a "&" [as per
the
expression]. These values wiill be stored in the Donations Table -
in
the
DonatedBy field - so we can get a sense of the recency and value of
donations.

--
Sue Compelling


:

If you just want to use text for what you show, you can set the Row
Source
Type to a Value List, then put text strings (separated by
semicolons)
as
the
values to show.

Are you wanting to show the exact strings that you posted? What
will
you
do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken - I want ALL THREE options to display in the combobox as
THREE
separate lines, and then I want the user to select ONE of the
three
options .
[The options are for 'declaring' WHO donated funds. ie - was it
the
couple
[parents], or as individuals [in the case of separated parents].
This
is
a
student fundraising db.
--
Sue Compelling


:

It's not clear what you want here. Do you want all three options
to
show
as
values in each row? Or do you want to show the three "options"
exactly
as
you've posted (which I admit would not seem to make sense)? Or
do
you
want
the ability to let the user select which option to show? Or do
you
want a
single value to show that will not have "blank or extra spaces"
if
a
value
doesn't exist in one or more of the fields?

--

Ken Snell
<MS ACCESS MVP>

in
message
Hi - really stuck on this one - a newbie and can 'do code' if
everything
is
supplied.

I want the following THREE options to be available from the
combobox
[and
am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " "
&
CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
K

Ken Snell [MVP]

This is what I'd asked in the very first reply <g>... whether you wanted
those exact strings or if you wanted to display actual data. So now we'll
need to undo what you just did.....sorry about that.

From where will the combo box draw the data that you want to display? (in
other words, what table holds the fields CG1FirstName, etc.?) What
field/control on the subform on which the combo box is determines which last
name and first name are to be shown?

What we'll want is a union query to present the three options as separate
rows in the combo box. Very simple to do, once I understand the table
structure where the desired data are stored, etc.
--

Ken Snell
<MS ACCESS MVP>


Sue Compelling said:
Thanks again .... Now this does allow me to select from 3 OPTIONS though
those options are the expressions [as below] rather than the resulting
names.
Any clues?

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName
CG1FirstName & " " & CG1LastName
CG2FirstName & " " & CG2LastName
--
Sue Compelling


Ken Snell said:
Change the RowSourceType to "Table/Query".

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken .... thanks - see below [ummmm - I'm also a newbie, so some of
this
may induce eye rolling]
--
Sue Compelling


:

It works for me when I set this up. So there may be something
incorrect
about your combobox.

Post here the values of all these properties for the combo box:

RowSourceType blank
RowSource SELECT fldString FROM tblStrings ORDER BY
fldOrder
ASC;
ColumnCount 1
ColumnWidths 5.053cm
BoundColumn 1
ControlSource DonatedBy
Format blank
--

Ken Snell
<MS ACCESS MVP>




message
Hi Ken -

Thanks for persevering. Did exactly as you described, however, when
I
go
to
the drop down it is simply a blank box.

[Is the fact that the combo box sits in a subform on a
TabControlPage
making
this impossible?]
--
Sue Compelling


:

In that case, probably the easiest thing to do is to create a table
(name
it
tblStrings) with two fields in it (fldOrder [number Long] and
fldString
[text 255]). Make fldOrder the primary key.

Then put each string into a record and put a number in the fldOrder
field
to
allow the strings to sort in the desired order.

Then use this query as the Row Source for that combo box:

SELECT fldString FROM tblStrings ORDER BY fldOrder ASC;

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken

Yes - I want the exact strings as per my original post. IF there
is
NO
second caregiver I'm OK if the combo box only returns a "&" [as
per
the
expression]. These values wiill be stored in the Donations
Table -
in
the
DonatedBy field - so we can get a sense of the recency and value
of
donations.

--
Sue Compelling


:

If you just want to use text for what you show, you can set the
Row
Source
Type to a Value List, then put text strings (separated by
semicolons)
as
the
values to show.

Are you wanting to show the exact strings that you posted? What
will
you
do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

in
message
Hi Ken - I want ALL THREE options to display in the combobox
as
THREE
separate lines, and then I want the user to select ONE of the
three
options .
[The options are for 'declaring' WHO donated funds. ie - was
it
the
couple
[parents], or as individuals [in the case of separated
parents].
This
is
a
student fundraising db.
--
Sue Compelling


:

It's not clear what you want here. Do you want all three
options
to
show
as
values in each row? Or do you want to show the three
"options"
exactly
as
you've posted (which I admit would not seem to make sense)?
Or
do
you
want
the ability to let the user select which option to show? Or
do
you
want a
single value to show that will not have "blank or extra
spaces"
if
a
value
doesn't exist in one or more of the fields?

--

Ken Snell
<MS ACCESS MVP>

"Sue Compelling" <[email protected]>
wrote
in
message
Hi - really stuck on this one - a newbie and can 'do code'
if
everything
is
supplied.

I want the following THREE options to be available from the
combobox
[and
am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & "
"
&
CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
G

Guest

Ken [mea culpa I think]

The Table is called Contacts and includes the fields:
CG1FirstName
CG1LastName
CG2FirstName
CG2LastName

The Form is called Contacts - though displays the information in three
TabControlPages called:

Caregiver Details
Additional Info
Donations

The Donations TabControlPage has the DonationsSubform with the following
fields
ContactID
DonationID
FundType
Amount
Date
DonatedBy ... [this is where I want the user to be able to select those 3
options]

Thanks Ken for your patience. I haven't done Union queries before though
funnily enough I was reading my Access User's Guide last night on them - will
be great to have you walk me through it.
--
Sue Compelling


Ken Snell said:
This is what I'd asked in the very first reply <g>... whether you wanted
those exact strings or if you wanted to display actual data. So now we'll
need to undo what you just did.....sorry about that.

From where will the combo box draw the data that you want to display? (in
other words, what table holds the fields CG1FirstName, etc.?) What
field/control on the subform on which the combo box is determines which last
name and first name are to be shown?

What we'll want is a union query to present the three options as separate
rows in the combo box. Very simple to do, once I understand the table
structure where the desired data are stored, etc.
--

Ken Snell
<MS ACCESS MVP>


Sue Compelling said:
Thanks again .... Now this does allow me to select from 3 OPTIONS though
those options are the expressions [as below] rather than the resulting
names.
Any clues?

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName
CG1FirstName & " " & CG1LastName
CG2FirstName & " " & CG2LastName
--
Sue Compelling


Ken Snell said:
Change the RowSourceType to "Table/Query".

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken .... thanks - see below [ummmm - I'm also a newbie, so some of
this
may induce eye rolling]
--
Sue Compelling


:

It works for me when I set this up. So there may be something
incorrect
about your combobox.

Post here the values of all these properties for the combo box:

RowSourceType blank
RowSource SELECT fldString FROM tblStrings ORDER BY
fldOrder
ASC;
ColumnCount 1
ColumnWidths 5.053cm
BoundColumn 1
ControlSource DonatedBy
Format blank
--

Ken Snell
<MS ACCESS MVP>




message
Hi Ken -

Thanks for persevering. Did exactly as you described, however, when
I
go
to
the drop down it is simply a blank box.

[Is the fact that the combo box sits in a subform on a
TabControlPage
making
this impossible?]
--
Sue Compelling


:

In that case, probably the easiest thing to do is to create a table
(name
it
tblStrings) with two fields in it (fldOrder [number Long] and
fldString
[text 255]). Make fldOrder the primary key.

Then put each string into a record and put a number in the fldOrder
field
to
allow the strings to sort in the desired order.

Then use this query as the Row Source for that combo box:

SELECT fldString FROM tblStrings ORDER BY fldOrder ASC;

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken

Yes - I want the exact strings as per my original post. IF there
is
NO
second caregiver I'm OK if the combo box only returns a "&" [as
per
the
expression]. These values wiill be stored in the Donations
Table -
in
the
DonatedBy field - so we can get a sense of the recency and value
of
donations.

--
Sue Compelling


:

If you just want to use text for what you show, you can set the
Row
Source
Type to a Value List, then put text strings (separated by
semicolons)
as
the
values to show.

Are you wanting to show the exact strings that you posted? What
will
you
do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

in
message
Hi Ken - I want ALL THREE options to display in the combobox
as
THREE
separate lines, and then I want the user to select ONE of the
three
options .
[The options are for 'declaring' WHO donated funds. ie - was
it
the
couple
[parents], or as individuals [in the case of separated
parents].
This
is
a
student fundraising db.
--
Sue Compelling


:

It's not clear what you want here. Do you want all three
options
to
show
as
values in each row? Or do you want to show the three
"options"
exactly
as
you've posted (which I admit would not seem to make sense)?
Or
do
you
want
the ability to let the user select which option to show? Or
do
you
want a
single value to show that will not have "blank or extra
spaces"
if
a
value
doesn't exist in one or more of the fields?

--

Ken Snell
<MS ACCESS MVP>

"Sue Compelling" <[email protected]>
wrote
in
message
Hi - really stuck on this one - a newbie and can 'do code'
if
everything
is
supplied.

I want the following THREE options to be available from the
combobox
[and
am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & "
"
&
CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
K

Ken Snell [MVP]

Based on what you have posted, the combo box's Row Source should be the
following string:

SELECT A.CG1FirstName & " " & A.CG1LastName
& " & " & A.CG2FirstName & " " & A.CG2LastName,
1 AS SortOrder FROM Contacts AS A
WHERE A.ContactID = [ContactID]
UNION ALL
SELECT B.CG1FirstName & " " & B.CG1LastName,
2 AS SortOrder FROM Contacts AS B
WHERE B.ContactID = [ContactID]
UNION ALL
SELECT C.CG2FirstName & " " & C.CG2LastName,
3 AS SortOrder FROM Contacts AS C
WHERE C.ContactID = [ContactID]
ORDER BY SortOrder;

--

Ken Snell
<MS ACCESS MVP>







Sue Compelling said:
Ken [mea culpa I think]

The Table is called Contacts and includes the fields:
CG1FirstName
CG1LastName
CG2FirstName
CG2LastName

The Form is called Contacts - though displays the information in three
TabControlPages called:

Caregiver Details
Additional Info
Donations

The Donations TabControlPage has the DonationsSubform with the following
fields
ContactID
DonationID
FundType
Amount
Date
DonatedBy ... [this is where I want the user to be able to select those 3
options]

Thanks Ken for your patience. I haven't done Union queries before though
funnily enough I was reading my Access User's Guide last night on them -
will
be great to have you walk me through it.
--
Sue Compelling


Ken Snell said:
This is what I'd asked in the very first reply <g>... whether you wanted
those exact strings or if you wanted to display actual data. So now we'll
need to undo what you just did.....sorry about that.

From where will the combo box draw the data that you want to display? (in
other words, what table holds the fields CG1FirstName, etc.?) What
field/control on the subform on which the combo box is determines which
last
name and first name are to be shown?

What we'll want is a union query to present the three options as separate
rows in the combo box. Very simple to do, once I understand the table
structure where the desired data are stored, etc.
--

Ken Snell
<MS ACCESS MVP>


message
Thanks again .... Now this does allow me to select from 3 OPTIONS
though
those options are the expressions [as below] rather than the resulting
names.
Any clues?

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName
CG1FirstName & " " & CG1LastName
CG2FirstName & " " & CG2LastName
--
Sue Compelling


:

Change the RowSourceType to "Table/Query".

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken .... thanks - see below [ummmm - I'm also a newbie, so some
of
this
may induce eye rolling]
--
Sue Compelling


:

It works for me when I set this up. So there may be something
incorrect
about your combobox.

Post here the values of all these properties for the combo box:

RowSourceType blank
RowSource SELECT fldString FROM tblStrings ORDER BY
fldOrder
ASC;
ColumnCount 1
ColumnWidths 5.053cm
BoundColumn 1
ControlSource DonatedBy
Format blank
--

Ken Snell
<MS ACCESS MVP>




message
Hi Ken -

Thanks for persevering. Did exactly as you described, however,
when
I
go
to
the drop down it is simply a blank box.

[Is the fact that the combo box sits in a subform on a
TabControlPage
making
this impossible?]
--
Sue Compelling


:

In that case, probably the easiest thing to do is to create a
table
(name
it
tblStrings) with two fields in it (fldOrder [number Long] and
fldString
[text 255]). Make fldOrder the primary key.

Then put each string into a record and put a number in the
fldOrder
field
to
allow the strings to sort in the desired order.

Then use this query as the Row Source for that combo box:

SELECT fldString FROM tblStrings ORDER BY fldOrder ASC;

--

Ken Snell
<MS ACCESS MVP>

in
message
Hi Ken

Yes - I want the exact strings as per my original post. IF
there
is
NO
second caregiver I'm OK if the combo box only returns a "&"
[as
per
the
expression]. These values wiill be stored in the Donations
Table -
in
the
DonatedBy field - so we can get a sense of the recency and
value
of
donations.

--
Sue Compelling


:

If you just want to use text for what you show, you can set
the
Row
Source
Type to a Value List, then put text strings (separated by
semicolons)
as
the
values to show.

Are you wanting to show the exact strings that you posted?
What
will
you
do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

"Sue Compelling" <[email protected]>
wrote
in
message
Hi Ken - I want ALL THREE options to display in the
combobox
as
THREE
separate lines, and then I want the user to select ONE of
the
three
options .
[The options are for 'declaring' WHO donated funds. ie -
was
it
the
couple
[parents], or as individuals [in the case of separated
parents].
This
is
a
student fundraising db.
--
Sue Compelling


:

It's not clear what you want here. Do you want all three
options
to
show
as
values in each row? Or do you want to show the three
"options"
exactly
as
you've posted (which I admit would not seem to make
sense)?
Or
do
you
want
the ability to let the user select which option to show?
Or
do
you
want a
single value to show that will not have "blank or extra
spaces"
if
a
value
doesn't exist in one or more of the fields?

--

Ken Snell
<MS ACCESS MVP>

"Sue Compelling" <[email protected]>
wrote
in
message
Hi - really stuck on this one - a newbie and can 'do
code'
if
everything
is
supplied.

I want the following THREE options to be available from
the
combobox
[and
am
assuming that it can be done]

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName
& "
"
&
CG2LastName

or

CG1FirstName & " " & CG1LastName

or

CG2FirstName & " " & CG2LastName

TIA
 
G

Guest

I feel a little embarrassed. You've put all this effort in and I still can't
get it to work. Do I simply cut and paste this code into the row source?
[which I did, though the combobox comes back blank]
--
Sue Compelling


Ken Snell said:
Based on what you have posted, the combo box's Row Source should be the
following string:

SELECT A.CG1FirstName & " " & A.CG1LastName
& " & " & A.CG2FirstName & " " & A.CG2LastName,
1 AS SortOrder FROM Contacts AS A
WHERE A.ContactID = [ContactID]
UNION ALL
SELECT B.CG1FirstName & " " & B.CG1LastName,
2 AS SortOrder FROM Contacts AS B
WHERE B.ContactID = [ContactID]
UNION ALL
SELECT C.CG2FirstName & " " & C.CG2LastName,
3 AS SortOrder FROM Contacts AS C
WHERE C.ContactID = [ContactID]
ORDER BY SortOrder;

--

Ken Snell
<MS ACCESS MVP>







Sue Compelling said:
Ken [mea culpa I think]

The Table is called Contacts and includes the fields:
CG1FirstName
CG1LastName
CG2FirstName
CG2LastName

The Form is called Contacts - though displays the information in three
TabControlPages called:

Caregiver Details
Additional Info
Donations

The Donations TabControlPage has the DonationsSubform with the following
fields
ContactID
DonationID
FundType
Amount
Date
DonatedBy ... [this is where I want the user to be able to select those 3
options]

Thanks Ken for your patience. I haven't done Union queries before though
funnily enough I was reading my Access User's Guide last night on them -
will
be great to have you walk me through it.
--
Sue Compelling


Ken Snell said:
This is what I'd asked in the very first reply <g>... whether you wanted
those exact strings or if you wanted to display actual data. So now we'll
need to undo what you just did.....sorry about that.

From where will the combo box draw the data that you want to display? (in
other words, what table holds the fields CG1FirstName, etc.?) What
field/control on the subform on which the combo box is determines which
last
name and first name are to be shown?

What we'll want is a union query to present the three options as separate
rows in the combo box. Very simple to do, once I understand the table
structure where the desired data are stored, etc.
--

Ken Snell
<MS ACCESS MVP>


message
Thanks again .... Now this does allow me to select from 3 OPTIONS
though
those options are the expressions [as below] rather than the resulting
names.
Any clues?

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName
CG1FirstName & " " & CG1LastName
CG2FirstName & " " & CG2LastName
--
Sue Compelling


:

Change the RowSourceType to "Table/Query".

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken .... thanks - see below [ummmm - I'm also a newbie, so some
of
this
may induce eye rolling]
--
Sue Compelling


:

It works for me when I set this up. So there may be something
incorrect
about your combobox.

Post here the values of all these properties for the combo box:

RowSourceType blank
RowSource SELECT fldString FROM tblStrings ORDER BY
fldOrder
ASC;
ColumnCount 1
ColumnWidths 5.053cm
BoundColumn 1
ControlSource DonatedBy
Format blank
--

Ken Snell
<MS ACCESS MVP>




message
Hi Ken -

Thanks for persevering. Did exactly as you described, however,
when
I
go
to
the drop down it is simply a blank box.

[Is the fact that the combo box sits in a subform on a
TabControlPage
making
this impossible?]
--
Sue Compelling


:

In that case, probably the easiest thing to do is to create a
table
(name
it
tblStrings) with two fields in it (fldOrder [number Long] and
fldString
[text 255]). Make fldOrder the primary key.

Then put each string into a record and put a number in the
fldOrder
field
to
allow the strings to sort in the desired order.

Then use this query as the Row Source for that combo box:

SELECT fldString FROM tblStrings ORDER BY fldOrder ASC;

--

Ken Snell
<MS ACCESS MVP>

in
message
Hi Ken

Yes - I want the exact strings as per my original post. IF
there
is
NO
second caregiver I'm OK if the combo box only returns a "&"
[as
per
the
expression]. These values wiill be stored in the Donations
Table -
in
the
DonatedBy field - so we can get a sense of the recency and
value
of
donations.

--
Sue Compelling


:

If you just want to use text for what you show, you can set
the
Row
Source
Type to a Value List, then put text strings (separated by
semicolons)
as
the
values to show.

Are you wanting to show the exact strings that you posted?
What
will
you
do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

"Sue Compelling" <[email protected]>
wrote
in
message
Hi Ken - I want ALL THREE options to display in the
combobox
as
THREE
separate lines, and then I want the user to select ONE of
the
three
options .
[The options are for 'declaring' WHO donated funds. ie -
was
it
the
couple
[parents], or as individuals [in the case of separated
parents].
This
is
a
student fundraising db.
--
Sue Compelling


:

It's not clear what you want here. Do you want all three
options
to
show
as
values in each row? Or do you want to show the three
"options"
exactly
as
you've posted (which I admit would not seem to make
sense)?
Or
do
you
want
the ability to let the user select which option to show?
Or
do
you
want a
single value to show that will not have "blank or extra
spaces"
if
 
G

Guest

Hi Ken - thanks for your help - I've cracked it ................
--
Sue Compelling


Sue Compelling said:
I feel a little embarrassed. You've put all this effort in and I still can't
get it to work. Do I simply cut and paste this code into the row source?
[which I did, though the combobox comes back blank]
--
Sue Compelling


Ken Snell said:
Based on what you have posted, the combo box's Row Source should be the
following string:

SELECT A.CG1FirstName & " " & A.CG1LastName
& " & " & A.CG2FirstName & " " & A.CG2LastName,
1 AS SortOrder FROM Contacts AS A
WHERE A.ContactID = [ContactID]
UNION ALL
SELECT B.CG1FirstName & " " & B.CG1LastName,
2 AS SortOrder FROM Contacts AS B
WHERE B.ContactID = [ContactID]
UNION ALL
SELECT C.CG2FirstName & " " & C.CG2LastName,
3 AS SortOrder FROM Contacts AS C
WHERE C.ContactID = [ContactID]
ORDER BY SortOrder;

--

Ken Snell
<MS ACCESS MVP>



CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName
CG1FirstName & " " & CG1LastName
CG2FirstName & " " & CG2LastName




Sue Compelling said:
Ken [mea culpa I think]

The Table is called Contacts and includes the fields:
CG1FirstName
CG1LastName
CG2FirstName
CG2LastName

The Form is called Contacts - though displays the information in three
TabControlPages called:

Caregiver Details
Additional Info
Donations

The Donations TabControlPage has the DonationsSubform with the following
fields
ContactID
DonationID
FundType
Amount
Date
DonatedBy ... [this is where I want the user to be able to select those 3
options]

Thanks Ken for your patience. I haven't done Union queries before though
funnily enough I was reading my Access User's Guide last night on them -
will
be great to have you walk me through it.
--
Sue Compelling


:

This is what I'd asked in the very first reply <g>... whether you wanted
those exact strings or if you wanted to display actual data. So now we'll
need to undo what you just did.....sorry about that.

From where will the combo box draw the data that you want to display? (in
other words, what table holds the fields CG1FirstName, etc.?) What
field/control on the subform on which the combo box is determines which
last
name and first name are to be shown?

What we'll want is a union query to present the three options as separate
rows in the combo box. Very simple to do, once I understand the table
structure where the desired data are stored, etc.
--

Ken Snell
<MS ACCESS MVP>


message
Thanks again .... Now this does allow me to select from 3 OPTIONS
though
those options are the expressions [as below] rather than the resulting
names.
Any clues?

CG1FirstName & " " & CG1LastName & " & " & CG2FirstName & " " &
CG2LastName
CG1FirstName & " " & CG1LastName
CG2FirstName & " " & CG2LastName
--
Sue Compelling


:

Change the RowSourceType to "Table/Query".

--

Ken Snell
<MS ACCESS MVP>

message
Hi Ken .... thanks - see below [ummmm - I'm also a newbie, so some
of
this
may induce eye rolling]
--
Sue Compelling


:

It works for me when I set this up. So there may be something
incorrect
about your combobox.

Post here the values of all these properties for the combo box:

RowSourceType blank
RowSource SELECT fldString FROM tblStrings ORDER BY
fldOrder
ASC;
ColumnCount 1
ColumnWidths 5.053cm
BoundColumn 1
ControlSource DonatedBy
Format blank
--

Ken Snell
<MS ACCESS MVP>




message
Hi Ken -

Thanks for persevering. Did exactly as you described, however,
when
I
go
to
the drop down it is simply a blank box.

[Is the fact that the combo box sits in a subform on a
TabControlPage
making
this impossible?]
--
Sue Compelling


:

In that case, probably the easiest thing to do is to create a
table
(name
it
tblStrings) with two fields in it (fldOrder [number Long] and
fldString
[text 255]). Make fldOrder the primary key.

Then put each string into a record and put a number in the
fldOrder
field
to
allow the strings to sort in the desired order.

Then use this query as the Row Source for that combo box:

SELECT fldString FROM tblStrings ORDER BY fldOrder ASC;

--

Ken Snell
<MS ACCESS MVP>

in
message
Hi Ken

Yes - I want the exact strings as per my original post. IF
there
is
NO
second caregiver I'm OK if the combo box only returns a "&"
[as
per
the
expression]. These values wiill be stored in the Donations
Table -
in
the
DonatedBy field - so we can get a sense of the recency and
value
of
donations.

--
Sue Compelling


:

If you just want to use text for what you show, you can set
the
Row
Source
Type to a Value List, then put text strings (separated by
semicolons)
as
the
values to show.

Are you wanting to show the exact strings that you posted?
What
will
you
do
with the value that the user selects in the combo box?

--

Ken Snell
<MS ACCESS MVP>

"Sue Compelling" <[email protected]>
wrote
in
message
Hi Ken - I want ALL THREE options to display in the
combobox
as
THREE
separate lines, and then I want the user to select ONE of
the
three
options .
[The options are for 'declaring' WHO donated funds. ie -
was
it
the
couple
[parents], or as individuals [in the case of separated
parents].
This
is
a
student fundraising db.
--
Sue Compelling


:

It's not clear what you want here. Do you want all three
options
to
show
as
values in each row? Or do you want to show the three
"options"
exactly
as
you've posted (which I admit would not seem to make
sense)?
Or
do
you
 
K

Ken Snell [MVP]

Congratulations!

--

Ken Snell
<MS ACCESS MVP>

Sue Compelling said:
Hi Ken - thanks for your help - I've cracked it ................
--
Sue Compelling


Sue Compelling said:
I feel a little embarrassed. You've put all this effort in and I still
can't
get it to work. Do I simply cut and paste this code into the row source?
[which I did, though the combobox comes back blank]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top