From: Glenn on
Hi,

I have built a database that contains a number of tables (a list is below)

TABLE: Acorn Data
TABLE: Contract Entered Data
TABLE: Payment Types

I have built an auto form using TABLE: Contract Entered Data as my record
source the form is called FORM: Input Contracts. This form has a number of
combo boxes which are linked to the table and field that contain the data.

So in table (TABLE: Sales Agent Data) there is a field (CL Code & Agent
Name) is have a combo box on my form and I have used the following Row Source

SELECT DISTINCTROW[CL Code & Agent Name]FROM[TABLE: Sales Agent Data]

When I load the user form and hit the arrow on my combo box I get the
following error message.

The Microsoft Jet database engine cannot find the input table or query
'SELECT DISTINCTROW[CL Code & Agent Name]FROM[TABLE: Sales Agent Data]'.
Make sure it exists and its name is spelled correctly.

The only workround I have for this is once the form is loaded click on
design then click straight away on normal view and the combo boxes work.

I need them to work when the form is loaded traight away.

Please can you help
From: Duane Hookom on
I don't know if this is a typo or not but:
SELECT DISTINCTROW[CL Code & Agent Name]FROM[TABLE: Sales Agent Data]
is missing several spaces and should be:
SELECT DISTINCTROW [CL Code & Agent Name] FROM [TABLE: Sales Agent Data]

IMO, you should find and use a naming convention that forbids spaces, &, :,
and other punctuation or symbols.


--
Duane Hookom
Microsoft Access MVP


"Glenn" wrote:

> Hi,
>
> I have built a database that contains a number of tables (a list is below)
>
> TABLE: Acorn Data
> TABLE: Contract Entered Data
> TABLE: Payment Types
>
> I have built an auto form using TABLE: Contract Entered Data as my record
> source the form is called FORM: Input Contracts. This form has a number of
> combo boxes which are linked to the table and field that contain the data.
>
> So in table (TABLE: Sales Agent Data) there is a field (CL Code & Agent
> Name) is have a combo box on my form and I have used the following Row Source
>
> SELECT DISTINCTROW[CL Code & Agent Name]FROM[TABLE: Sales Agent Data]
>
> When I load the user form and hit the arrow on my combo box I get the
> following error message.
>
> The Microsoft Jet database engine cannot find the input table or query
> 'SELECT DISTINCTROW[CL Code & Agent Name]FROM[TABLE: Sales Agent Data]'.
> Make sure it exists and its name is spelled correctly.
>
> The only workround I have for this is once the form is loaded click on
> design then click straight away on normal view and the combo boxes work.
>
> I need them to work when the form is loaded traight away.
>
> Please can you help