Problem with Combo box on form

G

Glenn

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
 
D

Duane Hookom

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.
 

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

Help with Query 2
Blank combo or list box 1
Combo box & Search Function 3
record source 1
Combo box in multiple tables within a database 4
combo box filter 1
Sort with Combo box 2
Cascading Fields in a form 1

Top