Find Dup. record in 2 Combo boxes?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a form let the user data entry store in the TableA. It have 2 combo
boxes (Cob1 and Cob2). Example:
Cob1=1,2,3,4,5 Cob2=10,20,30,40,50
I want when the user select Cob1=1 And Cob2=10 then the next time when they
select again Cob1=1 and Cob2=10 it will look into a TableA to find if it is
Duplicate data entry?
If Cob1=1 and Cob2=20 (30,40,50,... ) is OK
How can I code in the form? Thank you
MN
 
I think it would be easier to do it in the table. Backup the database first.
Open the table in design view and click on the menu VIEW - Indexes. create
an index of these two fields and set to unique.
 
Thank Karl for quickly reply,
So sorry for missing information. The combo box COB1 and COB2 are duplicate
now. So I could created unique :-(
So, please advise,
Regards. MN
 
This query will let you find the records that currently are duplicate --
SELECT [Table-A].Field1, [Table-A].Field2, Count([Table-A].Field1) AS
CountOfField1
FROM [Table-A]
GROUP BY [Table-A].Field1, [Table-A].Field2
HAVING (((Count([Table-A].Field1))>1));
 
Thank you for reply,
But I found no record duplicate.?
But my table have duplicate value?
Here is my SQL:
SELECT [Project1].ProjectID, [Project1].ReviewerID,
Count([Project1].ReviewerID) AS
CountOfField1
FROM [Project1]
group by [Project1].ProjectID, [Project1].ReviewerID
HAVING Count([Project1].ReviewerID)>1;

Anythrought? Thank in advange!
MN

KARL DEWEY said:
This query will let you find the records that currently are duplicate --
SELECT [Table-A].Field1, [Table-A].Field2, Count([Table-A].Field1) AS
CountOfField1
FROM [Table-A]
GROUP BY [Table-A].Field1, [Table-A].Field2
HAVING (((Count([Table-A].Field1))>1));


MN said:
Thank Karl for quickly reply,
So sorry for missing information. The combo box COB1 and COB2 are duplicate
now. So I could created unique :-(
So, please advise,
Regards. MN
 
But my table have duplicate value?
This I do not understand after you said > But I found no record duplicate.?

MN said:
Thank you for reply,
But I found no record duplicate.?
But my table have duplicate value?
Here is my SQL:
SELECT [Project1].ProjectID, [Project1].ReviewerID,
Count([Project1].ReviewerID) AS
CountOfField1
FROM [Project1]
group by [Project1].ProjectID, [Project1].ReviewerID
HAVING Count([Project1].ReviewerID)>1;

Anythrought? Thank in advange!
MN

KARL DEWEY said:
This query will let you find the records that currently are duplicate --
SELECT [Table-A].Field1, [Table-A].Field2, Count([Table-A].Field1) AS
CountOfField1
FROM [Table-A]
GROUP BY [Table-A].Field1, [Table-A].Field2
HAVING (((Count([Table-A].Field1))>1));


MN said:
Thank Karl for quickly reply,
So sorry for missing information. The combo box COB1 and COB2 are duplicate
now. So I could created unique :-(
So, please advise,
Regards. MN

:

I think it would be easier to do it in the table. Backup the database first.
Open the table in design view and click on the menu VIEW - Indexes. create
an index of these two fields and set to unique.

:

Hi,
I have a form let the user data entry store in the TableA. It have 2 combo
boxes (Cob1 and Cob2). Example:
Cob1=1,2,3,4,5 Cob2=10,20,30,40,50
I want when the user select Cob1=1 And Cob2=10 then the next time when they
select again Cob1=1 and Cob2=10 it will look into a TableA to find if it is
Duplicate data entry?
If Cob1=1 and Cob2=20 (30,40,50,... ) is OK
How can I code in the form? Thank you
MN
 
Thank for reply,
Sorry for confusion. My table have duplicate value, but after I ran my query
below the result is nothing(?) something wrong with the query?
To clarify again, here is example current my table have:
ProjectID ReviewerID
1 10
1 20
2 10
2 30
1 40
.....
In the Main form I created 2 button called Cob1 and Cob2
Cob1=ProjectID
Cob2=ReviewerID
When the user click to select Cob1=1 then IF user click to select Cob2=10
again then it will popup a message Duplicate record for ProjectID=1 and
ReviewerID=10.
How can I do that ? Thank you in advange.
MN

KARL DEWEY said:
But my table have duplicate value?
This I do not understand after you said > But I found no record duplicate.?

MN said:
Thank you for reply,
But I found no record duplicate.?
But my table have duplicate value?
Here is my SQL:
SELECT [Project1].ProjectID, [Project1].ReviewerID,
Count([Project1].ReviewerID) AS
CountOfField1
FROM [Project1]
group by [Project1].ProjectID, [Project1].ReviewerID
HAVING Count([Project1].ReviewerID)>1;

Anythrought? Thank in advange!
MN

KARL DEWEY said:
This query will let you find the records that currently are duplicate --
SELECT [Table-A].Field1, [Table-A].Field2, Count([Table-A].Field1) AS
CountOfField1
FROM [Table-A]
GROUP BY [Table-A].Field1, [Table-A].Field2
HAVING (((Count([Table-A].Field1))>1));


:

Thank Karl for quickly reply,
So sorry for missing information. The combo box COB1 and COB2 are duplicate
now. So I could created unique :-(
So, please advise,
Regards. MN

:

I think it would be easier to do it in the table. Backup the database first.
Open the table in design view and click on the menu VIEW - Indexes. create
an index of these two fields and set to unique.

:

Hi,
I have a form let the user data entry store in the TableA. It have 2 combo
boxes (Cob1 and Cob2). Example:
Cob1=1,2,3,4,5 Cob2=10,20,30,40,50
I want when the user select Cob1=1 And Cob2=10 then the next time when they
select again Cob1=1 and Cob2=10 it will look into a TableA to find if it is
Duplicate data entry?
If Cob1=1 and Cob2=20 (30,40,50,... ) is OK
How can I code in the form? Thank you
MN
 
The data --
ProjectID ReviewerID
1 10
1 20
2 10
2 30
1 40
is not duplicates as each in combination is unique.

As I said in my first post I think it would be easier to do it in the table
rather than using a popup. Backup the database first.
Open the table in design view and click on the menu VIEW - Indexes. create
an index of these two fields and set to unique.


MN said:
Thank for reply,
Sorry for confusion. My table have duplicate value, but after I ran my query
below the result is nothing(?) something wrong with the query?
To clarify again, here is example current my table have:
ProjectID ReviewerID
1 10
1 20
2 10
2 30
1 40
....
In the Main form I created 2 button called Cob1 and Cob2
Cob1=ProjectID
Cob2=ReviewerID
When the user click to select Cob1=1 then IF user click to select Cob2=10
again then it will popup a message Duplicate record for ProjectID=1 and
ReviewerID=10.
How can I do that ? Thank you in advange.
MN

KARL DEWEY said:
But my table have duplicate value?
This I do not understand after you said > But I found no record duplicate.?

MN said:
Thank you for reply,
But I found no record duplicate.?
But my table have duplicate value?
Here is my SQL:
SELECT [Project1].ProjectID, [Project1].ReviewerID,
Count([Project1].ReviewerID) AS
CountOfField1
FROM [Project1]
group by [Project1].ProjectID, [Project1].ReviewerID
HAVING Count([Project1].ReviewerID)>1;

Anythrought? Thank in advange!
MN

:

This query will let you find the records that currently are duplicate --
SELECT [Table-A].Field1, [Table-A].Field2, Count([Table-A].Field1) AS
CountOfField1
FROM [Table-A]
GROUP BY [Table-A].Field1, [Table-A].Field2
HAVING (((Count([Table-A].Field1))>1));


:

Thank Karl for quickly reply,
So sorry for missing information. The combo box COB1 and COB2 are duplicate
now. So I could created unique :-(
So, please advise,
Regards. MN

:

I think it would be easier to do it in the table. Backup the database first.
Open the table in design view and click on the menu VIEW - Indexes. create
an index of these two fields and set to unique.

:

Hi,
I have a form let the user data entry store in the TableA. It have 2 combo
boxes (Cob1 and Cob2). Example:
Cob1=1,2,3,4,5 Cob2=10,20,30,40,50
I want when the user select Cob1=1 And Cob2=10 then the next time when they
select again Cob1=1 and Cob2=10 it will look into a TableA to find if it is
Duplicate data entry?
If Cob1=1 and Cob2=20 (30,40,50,... ) is OK
How can I code in the form? Thank you
MN
 
Thank Karl,
But I can not do "create an index of these two fields and set to unique." as
you say. Could you please show me how to do it? It let me select only 1 field
only.
Regards,
MN

KARL DEWEY said:
The data --
ProjectID ReviewerID
1 10
1 20
2 10
2 30
1 40
is not duplicates as each in combination is unique.

As I said in my first post I think it would be easier to do it in the table
rather than using a popup. Backup the database first.
Open the table in design view and click on the menu VIEW - Indexes. create
an index of these two fields and set to unique.


MN said:
Thank for reply,
Sorry for confusion. My table have duplicate value, but after I ran my query
below the result is nothing(?) something wrong with the query?
To clarify again, here is example current my table have:
ProjectID ReviewerID
1 10
1 20
2 10
2 30
1 40
....
In the Main form I created 2 button called Cob1 and Cob2
Cob1=ProjectID
Cob2=ReviewerID
When the user click to select Cob1=1 then IF user click to select Cob2=10
again then it will popup a message Duplicate record for ProjectID=1 and
ReviewerID=10.
How can I do that ? Thank you in advange.
MN

KARL DEWEY said:
But my table have duplicate value?
This I do not understand after you said > But I found no record duplicate.?

:

Thank you for reply,
But I found no record duplicate.?
But my table have duplicate value?
Here is my SQL:
SELECT [Project1].ProjectID, [Project1].ReviewerID,
Count([Project1].ReviewerID) AS
CountOfField1
FROM [Project1]
group by [Project1].ProjectID, [Project1].ReviewerID
HAVING Count([Project1].ReviewerID)>1;

Anythrought? Thank in advange!
MN

:

This query will let you find the records that currently are duplicate --
SELECT [Table-A].Field1, [Table-A].Field2, Count([Table-A].Field1) AS
CountOfField1
FROM [Table-A]
GROUP BY [Table-A].Field1, [Table-A].Field2
HAVING (((Count([Table-A].Field1))>1));


:

Thank Karl for quickly reply,
So sorry for missing information. The combo box COB1 and COB2 are duplicate
now. So I could created unique :-(
So, please advise,
Regards. MN

:

I think it would be easier to do it in the table. Backup the database first.
Open the table in design view and click on the menu VIEW - Indexes. create
an index of these two fields and set to unique.

:

Hi,
I have a form let the user data entry store in the TableA. It have 2 combo
boxes (Cob1 and Cob2). Example:
Cob1=1,2,3,4,5 Cob2=10,20,30,40,50
I want when the user select Cob1=1 And Cob2=10 then the next time when they
select again Cob1=1 and Cob2=10 it will look into a TableA to find if it is
Duplicate data entry?
If Cob1=1 and Cob2=20 (30,40,50,... ) is OK
How can I code in the form? Thank you
MN
 
Open the table in design view. Click on menu VIEW – Indexes.
This opens another window. Select the fields. Type in an index name in the
same row as the first field selected.
A sub-window then opens. Select Unique –Yes. You may want to exclude nulls
or not.


MN said:
Thank Karl,
But I can not do "create an index of these two fields and set to unique." as
you say. Could you please show me how to do it? It let me select only 1 field
only.
Regards,
MN

KARL DEWEY said:
The data --
ProjectID ReviewerID
1 10
1 20
2 10
2 30
1 40
is not duplicates as each in combination is unique.

As I said in my first post I think it would be easier to do it in the table
rather than using a popup. Backup the database first.
Open the table in design view and click on the menu VIEW - Indexes. create
an index of these two fields and set to unique.


MN said:
Thank for reply,
Sorry for confusion. My table have duplicate value, but after I ran my query
below the result is nothing(?) something wrong with the query?
To clarify again, here is example current my table have:
ProjectID ReviewerID
1 10
1 20
2 10
2 30
1 40
....
In the Main form I created 2 button called Cob1 and Cob2
Cob1=ProjectID
Cob2=ReviewerID
When the user click to select Cob1=1 then IF user click to select Cob2=10
again then it will popup a message Duplicate record for ProjectID=1 and
ReviewerID=10.
How can I do that ? Thank you in advange.
MN

:
But my table have duplicate value?
This I do not understand after you said > But I found no record duplicate.?

:

Thank you for reply,
But I found no record duplicate.?
But my table have duplicate value?
Here is my SQL:
SELECT [Project1].ProjectID, [Project1].ReviewerID,
Count([Project1].ReviewerID) AS
CountOfField1
FROM [Project1]
group by [Project1].ProjectID, [Project1].ReviewerID
HAVING Count([Project1].ReviewerID)>1;

Anythrought? Thank in advange!
MN

:

This query will let you find the records that currently are duplicate --
SELECT [Table-A].Field1, [Table-A].Field2, Count([Table-A].Field1) AS
CountOfField1
FROM [Table-A]
GROUP BY [Table-A].Field1, [Table-A].Field2
HAVING (((Count([Table-A].Field1))>1));


:

Thank Karl for quickly reply,
So sorry for missing information. The combo box COB1 and COB2 are duplicate
now. So I could created unique :-(
So, please advise,
Regards. MN

:

I think it would be easier to do it in the table. Backup the database first.
Open the table in design view and click on the menu VIEW - Indexes. create
an index of these two fields and set to unique.

:

Hi,
I have a form let the user data entry store in the TableA. It have 2 combo
boxes (Cob1 and Cob2). Example:
Cob1=1,2,3,4,5 Cob2=10,20,30,40,50
I want when the user select Cob1=1 And Cob2=10 then the next time when they
select again Cob1=1 and Cob2=10 it will look into a TableA to find if it is
Duplicate data entry?
If Cob1=1 and Cob2=20 (30,40,50,... ) is OK
How can I code in the form? Thank you
MN
 
Thank Karl,
But the error is: " The changes you requested to the table were not
sucessful because they would create duplicate values .... redefine the index
to permit duplicate entries and try again. "
I selected fields "ProjectID"
Please advise,
MN
 
Why did you not select ProjectID and ReviewerID? This combination is what
you are looking for.
 
Thank you for reply,
OK, I go table click on disign --> From View --> Indexes. A window Index open.
In the Index Name column I typed PriKey1--In the Column Field Name it has a
pulldown listed all available fields (But it's let me select 1 field each
time only (?))
In the Sort Order I Selected Ascending.
Click close to save I got an error as describe for you before that.
Anyway, Thank you very much for help me out.
I found a solution, I using Dcount function it work :-)

DCount("*", "Project1", "[ReviewerID] = " & Me!ReviewerID & " AND
[ProjectID] = " & Me!ProjectID) > 0
Thanks you Karl a lot of to take time to help me out...
Best Regards,
MN
 
OK, go table click on disign --> From View --> Indexes. A window Index open.
In the Index Name column I typed PriKey1--In the Column Field Name it has a
pulldown listed all available fields. In the Sort Order I Selected Ascending.

Go to the second row and select your second field. Click back on first row
and a sub-window opens. Select Unique.

Save.

MN said:
Thank you for reply,
OK, I go table click on disign --> From View --> Indexes. A window Index open.
In the Index Name column I typed PriKey1--In the Column Field Name it has a
pulldown listed all available fields (But it's let me select 1 field each
time only (?))
In the Sort Order I Selected Ascending.
Click close to save I got an error as describe for you before that.
Anyway, Thank you very much for help me out.
I found a solution, I using Dcount function it work :-)

DCount("*", "Project1", "[ReviewerID] = " & Me!ReviewerID & " AND
[ProjectID] = " & Me!ProjectID) > 0
Thanks you Karl a lot of to take time to help me out...
Best Regards,
MN
KARL DEWEY said:
Why did you not select ProjectID and ReviewerID? This combination is what
you are looking for.
 
It working beautiful...
Thank a ton!
Regards,
MN
KARL DEWEY said:
OK, go table click on disign --> From View --> Indexes. A window Index open.
In the Index Name column I typed PriKey1--In the Column Field Name it has a
pulldown listed all available fields. In the Sort Order I Selected Ascending.

Go to the second row and select your second field. Click back on first row
and a sub-window opens. Select Unique.

Save.

MN said:
Thank you for reply,
OK, I go table click on disign --> From View --> Indexes. A window Index open.
In the Index Name column I typed PriKey1--In the Column Field Name it has a
pulldown listed all available fields (But it's let me select 1 field each
time only (?))
In the Sort Order I Selected Ascending.
Click close to save I got an error as describe for you before that.
Anyway, Thank you very much for help me out.
I found a solution, I using Dcount function it work :-)

DCount("*", "Project1", "[ReviewerID] = " & Me!ReviewerID & " AND
[ProjectID] = " & Me!ProjectID) > 0
Thanks you Karl a lot of to take time to help me out...
Best Regards,
MN
KARL DEWEY said:
Why did you not select ProjectID and ReviewerID? This combination is what
you are looking for.


:

Thank Karl,
But the error is: " The changes you requested to the table were not
sucessful because they would create duplicate values .... redefine the index
to permit duplicate entries and try again. "
I selected fields "ProjectID"
Please advise,
MN

:

Open the table in design view. Click on menu VIEW – Indexes.
This opens another window. Select the fields. Type in an index name in the
same row as the first field selected.
A sub-window then opens. Select Unique –Yes. You may want to exclude nulls
or not.


:

Thank Karl,
But I can not do "create an index of these two fields and set to unique." as
you say. Could you please show me how to do it? It let me select only 1 field
only.
Regards,
MN
 
Back
Top