T
Tony Williams
I have a form whose control source is a query. The query compares two tables,
without any fields being linked in a relationship, and looks for records in
both tables where data in certain fields is duplicated. When I run the query
from design view it returns results. I have a command button on a form that
should run the query and then populate another form with the results. I know
the query is running becuse the hourglass is there for a while but when the
form opens there are no records showing.
Here is the sql for the query
SELECT VDATAPNC.txtVRM, VDATAPNC.txtVIN, VDATAPNC.txtstatus,
VDATAPNC.txtimportdate, VDATAPNC.txtowner, VDATAPNC.txtmake, VDATAPNC.txtmodel
FROM VDATAPNC, Semita
WHERE (((VDATAPNC.txtVRM)=[semita].[txtvrm]) AND ((VDATAPNC.txtstatus)="01")
AND ((VDATAPNC.txtimportdate)=[semita].[txtimportdate])) OR
(((VDATAPNC.txtVIN)=[semita].[txtvin]) AND ((VDATAPNC.txtstatus)="01") AND
((VDATAPNC.txtimportdate)=[semita].[txtimportdate]));
And here is the code behind my commnad button
Private Sub cmdopendups_Click()
On Error GoTo Err_cmdopendups_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmduplicates"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdopendups_Click:
Exit Sub
Err_cmdopendups_Click:
MsgBox Err.Description
Resume Exit_cmdopendups_Click
End Sub
Can anyone see anything I'm doing wrong?
Thanks
Tony
without any fields being linked in a relationship, and looks for records in
both tables where data in certain fields is duplicated. When I run the query
from design view it returns results. I have a command button on a form that
should run the query and then populate another form with the results. I know
the query is running becuse the hourglass is there for a while but when the
form opens there are no records showing.
Here is the sql for the query
SELECT VDATAPNC.txtVRM, VDATAPNC.txtVIN, VDATAPNC.txtstatus,
VDATAPNC.txtimportdate, VDATAPNC.txtowner, VDATAPNC.txtmake, VDATAPNC.txtmodel
FROM VDATAPNC, Semita
WHERE (((VDATAPNC.txtVRM)=[semita].[txtvrm]) AND ((VDATAPNC.txtstatus)="01")
AND ((VDATAPNC.txtimportdate)=[semita].[txtimportdate])) OR
(((VDATAPNC.txtVIN)=[semita].[txtvin]) AND ((VDATAPNC.txtstatus)="01") AND
((VDATAPNC.txtimportdate)=[semita].[txtimportdate]));
And here is the code behind my commnad button
Private Sub cmdopendups_Click()
On Error GoTo Err_cmdopendups_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmduplicates"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdopendups_Click:
Exit Sub
Err_cmdopendups_Click:
MsgBox Err.Description
Resume Exit_cmdopendups_Click
End Sub
Can anyone see anything I'm doing wrong?
Thanks
Tony