define new field in query

D

DianaS

Hi,

I would like to create a new field in a query that will be the second column
of an existing combo-box field. I know how to do this in a form:

[ComboBoxName].[Column](1)

but, when I try the same thing in the query design view, it does not work.
Does anyone know how to approach this problem? Thanks.

Diana
 
R

Rick B

You can't use a combo box in a query like that. Just put the actual field
that you want. Give us your structure and more details if you ened more
help.

For example, if a combo-box contains IDNumber, FirstName, LastName, etc.
then simply pull the FirstName.
 
D

DianaS

Hi,

I think I need more help--the query is based on [Table1]. [Table1] contains
a combobox field called [FieldCombo] that is based on another table called
[TableCombo]. I want to auto-fill new fields in the query according to the
column contents of [FieldCombo].

Are you suggesting that I link the query to [TableCombo] in addition to
[Table1]? Will this allow for the auto-fill function?

Thanks,
Diana

Rick B said:
You can't use a combo box in a query like that. Just put the actual field
that you want. Give us your structure and more details if you ened more
help.

For example, if a combo-box contains IDNumber, FirstName, LastName, etc.
then simply pull the FirstName.

--
Rick B



DianaS said:
Hi,

I would like to create a new field in a query that will be the second column
of an existing combo-box field. I know how to do this in a form:

[ComboBoxName].[Column](1)

but, when I try the same thing in the query design view, it does not work.
Does anyone know how to approach this problem? Thanks.

Diana
 
R

Rick B

Not sure what you mean by "autofill" but yes, if your query will pull data
from more than one table, you need to include all the tables used in your
query. A query can pull fields from many different tables as long as you
have the relationship established so Access knows how to find the
appropriate record in each table.


--
Rick B



DianaS said:
Hi,

I think I need more help--the query is based on [Table1]. [Table1] contains
a combobox field called [FieldCombo] that is based on another table called
[TableCombo]. I want to auto-fill new fields in the query according to the
column contents of [FieldCombo].

Are you suggesting that I link the query to [TableCombo] in addition to
[Table1]? Will this allow for the auto-fill function?

Thanks,
Diana

Rick B said:
You can't use a combo box in a query like that. Just put the actual field
that you want. Give us your structure and more details if you ened more
help.

For example, if a combo-box contains IDNumber, FirstName, LastName, etc.
then simply pull the FirstName.

--
Rick B



DianaS said:
Hi,

I would like to create a new field in a query that will be the second column
of an existing combo-box field. I know how to do this in a form:

[ComboBoxName].[Column](1)

but, when I try the same thing in the query design view, it does not work.
Does anyone know how to approach this problem? Thanks.

Diana
 
D

DianaS

Hi,

By "autofill" I mean the function where you can select a category from a
combo box and automatically fill other fields with text based on your
selection.

When I add [TableCombo] to the query, my records quadruple in number
(identical copies). I have played with the table relationships, but nothing
seems to work.

Thanks,
Diana

Rick B said:
Not sure what you mean by "autofill" but yes, if your query will pull data
from more than one table, you need to include all the tables used in your
query. A query can pull fields from many different tables as long as you
have the relationship established so Access knows how to find the
appropriate record in each table.


--
Rick B



DianaS said:
Hi,

I think I need more help--the query is based on [Table1]. [Table1] contains
a combobox field called [FieldCombo] that is based on another table called
[TableCombo]. I want to auto-fill new fields in the query according to the
column contents of [FieldCombo].

Are you suggesting that I link the query to [TableCombo] in addition to
[Table1]? Will this allow for the auto-fill function?

Thanks,
Diana

Rick B said:
You can't use a combo box in a query like that. Just put the actual field
that you want. Give us your structure and more details if you ened more
help.

For example, if a combo-box contains IDNumber, FirstName, LastName, etc.
then simply pull the FirstName.

--
Rick B



Hi,

I would like to create a new field in a query that will be the second
column
of an existing combo-box field. I know how to do this in a form:

[ComboBoxName].[Column](1)

but, when I try the same thing in the query design view, it does not work.
Does anyone know how to approach this problem? Thanks.

Diana
 
R

Rick B

Post the sql of your query here.



--
Rick B



DianaS said:
Hi,

By "autofill" I mean the function where you can select a category from a
combo box and automatically fill other fields with text based on your
selection.

When I add [TableCombo] to the query, my records quadruple in number
(identical copies). I have played with the table relationships, but nothing
seems to work.

Thanks,
Diana

Rick B said:
Not sure what you mean by "autofill" but yes, if your query will pull data
from more than one table, you need to include all the tables used in your
query. A query can pull fields from many different tables as long as you
have the relationship established so Access knows how to find the
appropriate record in each table.


--
Rick B



DianaS said:
Hi,

I think I need more help--the query is based on [Table1]. [Table1] contains
a combobox field called [FieldCombo] that is based on another table called
[TableCombo]. I want to auto-fill new fields in the query according
to
the
column contents of [FieldCombo].

Are you suggesting that I link the query to [TableCombo] in addition to
[Table1]? Will this allow for the auto-fill function?

Thanks,
Diana

:

You can't use a combo box in a query like that. Just put the actual field
that you want. Give us your structure and more details if you ened more
help.

For example, if a combo-box contains IDNumber, FirstName, LastName, etc.
then simply pull the FirstName.

--
Rick B



Hi,

I would like to create a new field in a query that will be the second
column
of an existing combo-box field. I know how to do this in a form:

[ComboBoxName].[Column](1)

but, when I try the same thing in the query design view, it does
not
work.
Does anyone know how to approach this problem? Thanks.

Diana
 
D

DianaS

Thank you--here is the SQL (w/out problematic table that adds record
duplicates--would you like the SQL when duplicates occur too?)

SELECT [MVC Schedule].KeyCode, [MVC Schedule].ResvStatus, [MVC
Schedule].LeadNumber, [MVC Schedule].TourNumber, [MVC Core].[First Name1],
[MVC Core].[Last Name1], [MVC Core].[First Name2], [MVC Core].[Last Name2],
[MVC Core].Address, [MVC Core].City, [MVC Core].State, [MVC Core].PostalCode,
[MVC Schedule].ResDateArrive, [MVC Schedule].ResDateDepart, [MVC
Schedule].Lodging, [MVC Schedule].[Tour Date], [MVC Schedule].[Tour Time],
[MVC Schedule].[Confirm#], [tblAssoc#].tblAssocName,
[tblAssoc#].tblAssocExtn, IIf(IsNull([Last Name2]),[First Name1] & " " &
[Last Name1],IIf([Last Name2]=[Last Name1],[First Name1] & " and " & [First
Name2] & " " & [Last Name1],[First Name1] & " " & [Last Name1] & " and " &
[First Name2] & " " & [Last Name2])) AS Salutation
FROM [MVC Core] INNER JOIN ([tblAssoc#] INNER JOIN [MVC Schedule] ON
[tblAssoc#].[tblAssoc#] = [MVC Schedule].[Assoc#]) ON [MVC Core].LeadNumber =
[MVC Schedule].LeadNumber
WHERE ((([MVC Schedule].KeyCode)="MOR" Or ([MVC Schedule].KeyCode)="451" Or
([MVC Schedule].KeyCode)="HOORAY" Or ([MVC Schedule].KeyCode)="JOY 2005" Or
([MVC Schedule].KeyCode)="NOR") AND (([MVC Schedule].ResvStatus)="Bkd"));


Rick B said:
Post the sql of your query here.



--
Rick B



DianaS said:
Hi,

By "autofill" I mean the function where you can select a category from a
combo box and automatically fill other fields with text based on your
selection.

When I add [TableCombo] to the query, my records quadruple in number
(identical copies). I have played with the table relationships, but nothing
seems to work.

Thanks,
Diana

Rick B said:
Not sure what you mean by "autofill" but yes, if your query will pull data
from more than one table, you need to include all the tables used in your
query. A query can pull fields from many different tables as long as you
have the relationship established so Access knows how to find the
appropriate record in each table.


--
Rick B



Hi,

I think I need more help--the query is based on [Table1]. [Table1]
contains
a combobox field called [FieldCombo] that is based on another table called
[TableCombo]. I want to auto-fill new fields in the query according to
the
column contents of [FieldCombo].

Are you suggesting that I link the query to [TableCombo] in addition to
[Table1]? Will this allow for the auto-fill function?

Thanks,
Diana

:

You can't use a combo box in a query like that. Just put the actual
field
that you want. Give us your structure and more details if you ened more
help.

For example, if a combo-box contains IDNumber, FirstName, LastName, etc.
then simply pull the FirstName.

--
Rick B



Hi,

I would like to create a new field in a query that will be the second
column
of an existing combo-box field. I know how to do this in a form:

[ComboBoxName].[Column](1)

but, when I try the same thing in the query design view, it does not
work.
Does anyone know how to approach this problem? Thanks.

Diana
 
D

DianaS

Hi,

I appreciate the help--found the solution to the problem. The relationship
between two of my tables was wrong.

Diana
 
Top