comparing data and creating tables

C

Cynthia

I am bring in a list of circuits by putting
=ListCircRoute([CircID]) in the control of my text box which calls up the
function below. I am concatenating 100 to 150 items that are about 10 char
long.
This works fine for my reporting purposes.

My problem is the next time I issue the report I need to know if any of the
data is different. Is there a compare function that I can use?
Can I write this data below out to a table with the revision of the report
then when I run the report again pull the information from the table and
compare with this new string?
I'm not sure how to compare the data and I do not know how to create a table
from code.

Public Function ListCircRoute(lngCircID) As String
Dim cn As Object
Dim rs As Object
Dim strSql As String
Dim strCircuits As String
' Initilize connection and recordset objects
Set cn = Application.CurrentProject.Connection
Set rs = CreateObject("ADODB.Recordset")

If IsNull(lngCircID) Then lngCircID = -5

strSql = "SELECT qryCircuitRouteID.RouteDesc, qryCircuitRouteID.RouteNum
FROM qryCircuitRouteID WHERE (((qryCircuitRouteID.CircID)=" & lngCircID & "))
ORDER BY qryCircuitRouteID.RouteNum;"
Debug.Print strSql
rs.Open strSql, cn, 1

' Loop through recordset and add drawing names
If (rs.EOF) Then
strCircuits = ""
Else
With rs
Do While Not (.EOF)
strCircuits = strCircuits & "[" & !RouteNum & "]" &
!RouteDesc & ", "
.MoveNext
Loop
End With
End If

' Trim trailing ", "
If Not (strCircuits = "") Then strCircuits = Left$(strCircuits,
Len(strCircuits) - 2)
ListCircRoute = strCircuits


End Function
 

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