Hello,
Can someone offer some advice. I am trying to write a little function that when called will run a query to tell me if there are matching records in the two tables - if there are i need it to give me a message box stating so. I had tried once and could not make it work. I am looking in an Access 97 book and came up with this so far
Private Function TrialQuery()
Set dbCurrent = CurrentDb()
strSQL = "SELECT [Premium Failures].* FROM [Premium Failures] INNER JOIN [Premium Failures (2)] ON ([Premium Failures].[B/L #] = [Premium Failures (2)].[B/L #]) AND ([Premium Failures].[Details 9AM_10:30_Sat] = [Premium Failures (2)].[Details 9AM_10:30_US]) AND ([Premium Failures].Terminal = [Premium Failures (2)].Terminal) AND ([Premium Failures].[Date of Failure] = [Premium Failures (2)].[Date of Failure]);"
Set qdfCurrent = dbCurrent.CreateQueryDef("qryCurrent", strSQL)
Set rsdCurrent = dbCurrent.OpenRecordset("qryCurrent", dbOpenDynaset)
rsdCurrent.MoveLast
End Function
now i'm stumped - any advice would be very appreciated.
Thanks!
Can someone offer some advice. I am trying to write a little function that when called will run a query to tell me if there are matching records in the two tables - if there are i need it to give me a message box stating so. I had tried once and could not make it work. I am looking in an Access 97 book and came up with this so far
Private Function TrialQuery()
Set dbCurrent = CurrentDb()
strSQL = "SELECT [Premium Failures].* FROM [Premium Failures] INNER JOIN [Premium Failures (2)] ON ([Premium Failures].[B/L #] = [Premium Failures (2)].[B/L #]) AND ([Premium Failures].[Details 9AM_10:30_Sat] = [Premium Failures (2)].[Details 9AM_10:30_US]) AND ([Premium Failures].Terminal = [Premium Failures (2)].Terminal) AND ([Premium Failures].[Date of Failure] = [Premium Failures (2)].[Date of Failure]);"
Set qdfCurrent = dbCurrent.CreateQueryDef("qryCurrent", strSQL)
Set rsdCurrent = dbCurrent.OpenRecordset("qryCurrent", dbOpenDynaset)
rsdCurrent.MoveLast
End Function
now i'm stumped - any advice would be very appreciated.
Thanks!