using a from to query a report

S

Sean

I have Joblist setup that has Job#, Description of the job, Customer, etc.
The Customer column is a drop down menu linked to a Customer list.

Anyway i made a form with a drop down list that brings up a report of all
the jobs by customer (The drop down list also pulls from the Customer list)
and it works. After you pick teh customer name from the drop down list I
have a button setup on the form called "View Job List" which pulls up the
report. The issue is when you close the report I get this error "The changes
you requested to the table were not successful because they would create
duplicate values in teh index, primary key, or relationship. Change the data
in the field or fields that contain duplicate data, remove the index, or
redifine the index to permit duplicate entries and try again." I'm thinking
I have the form setup wrong as I'm not trying to change any data in the table
just trying to view particular data. I noticed that if I click the View Job
list button using the Customer name that is shown in the list by default
(It's just showing the customer that starts with "A" [alphabetical]) it works
fine because I didn't choose a customer.

Any ideas?
Thanks.
 
A

Al Campagna

Sean,
Sounds like your combo is "bound" to your actual customer table.
Whenever you select a Customer your actually changing that Customer Record,
and that creates a duplicate. Your actually always changing the customer
for the first record in your customer table.
Ergo...
I noticed that if I click the View Job
list button using the Customer name that is shown in the list by
default it works.

Dialog type forms usually use "unbound" controls to select criteria for
the report's query.
Clear the ControlSource, and have your report query use...
Forms!frmYourFormName!cboCustomer
as the criteria.

Also, you wrote...
After you pick teh customer name from the drop down list...
You really should be selecting a unique key value, like CustomerID,
instead of a name. Duplicate names are common.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Sean said:
I have Joblist setup that has Job#, Description of the job, Customer, etc.
The Customer column is a drop down menu linked to a Customer list.

Anyway i made a form with a drop down list that brings up a report of all
the jobs by customer (The drop down list also pulls from the Customer
list)
and it works. After you pick teh customer name from the drop down list I
have a button setup on the form called "View Job List" which pulls up the
report. The issue is when you close the report I get this error "The
changes
you requested to the table were not successful because they would create
duplicate values in teh index, primary key, or relationship. Change the
data
in the field or fields that contain duplicate data, remove the index, or
redifine the index to permit duplicate entries and try again." I'm
thinking
I have the form setup wrong as I'm not trying to change any data in the
table
just trying to view particular data. I noticed that if I click the View
Job
list button using the Customer name that is shown in the list by default
(It's just showing the customer that starts with "A" [alphabetical]) it
works
fine because I didn't choose a customer.

Any ideas?
Thanks.
 
S

Sean

Thanks, actually the only thing I had to do was clear the control source and
now it works. Why do I always look for something more complicated to fix
things?

As for the Customer name. We do work for companies and our customer list is
only about 100 customers so we don't get duplicate names so for us this
format works well.

Thanks for the input and the help.
--
One day I may know what I''''''''m doing.


Al Campagna said:
Sean,
Sounds like your combo is "bound" to your actual customer table.
Whenever you select a Customer your actually changing that Customer Record,
and that creates a duplicate. Your actually always changing the customer
for the first record in your customer table.
Ergo...
I noticed that if I click the View Job
list button using the Customer name that is shown in the list by
default it works.

Dialog type forms usually use "unbound" controls to select criteria for
the report's query.
Clear the ControlSource, and have your report query use...
Forms!frmYourFormName!cboCustomer
as the criteria.

Also, you wrote...
After you pick teh customer name from the drop down list...
You really should be selecting a unique key value, like CustomerID,
instead of a name. Duplicate names are common.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

Sean said:
I have Joblist setup that has Job#, Description of the job, Customer, etc.
The Customer column is a drop down menu linked to a Customer list.

Anyway i made a form with a drop down list that brings up a report of all
the jobs by customer (The drop down list also pulls from the Customer
list)
and it works. After you pick teh customer name from the drop down list I
have a button setup on the form called "View Job List" which pulls up the
report. The issue is when you close the report I get this error "The
changes
you requested to the table were not successful because they would create
duplicate values in teh index, primary key, or relationship. Change the
data
in the field or fields that contain duplicate data, remove the index, or
redifine the index to permit duplicate entries and try again." I'm
thinking
I have the form setup wrong as I'm not trying to change any data in the
table
just trying to view particular data. I noticed that if I click the View
Job
list button using the Customer name that is shown in the list by default
(It's just showing the customer that starts with "A" [alphabetical]) it
works
fine because I didn't choose a customer.

Any ideas?
Thanks.
 

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

Top