G
Guest
Hi all,
I have a script that assigns a biological season to each record in a Caribou
database based on the date of it's sattelite transmission. It works just
fine on my computer but for some reason when my co-worker run's it from her
computer some of the records consistently get assigned the wrong season. I
have pasted the nuts and bolts of the code below:
Private Sub ADDBIOL_SEASON()
Dim cnnMM As ADODB.Connection, rstmm As ADODB.Recordset
Dim strDay As Date
Set cnnMM = Application.CurrentProject.Connection
Set rstmm = New ADODB.Recordset
rstmm.Open Source:="Sheet1", ActiveConnection:=cnnMM,
CursorType:=adOpenStatic, LockType:=adLockPessimistic
numrec = rstmm.RecordCount
rstmm.MoveFirst
For i = 0 To (numrec - 1)
If Not rstmm.Fields("Date").Value Then
strDay = rstmm.Fields("Date").Value
If strDay > "28-Nov-1981" And strDay < "27-Apr-1982" Then
rstmm.Fields("BIOL_SEASON").Value = "Wintering"
ElseIf strDay > "28-Nov-1982" And strDay < "27-Apr-1983" Then
rstmm.Fields("BIOL_SEASON").Value = "Wintering"
I have a script that assigns a biological season to each record in a Caribou
database based on the date of it's sattelite transmission. It works just
fine on my computer but for some reason when my co-worker run's it from her
computer some of the records consistently get assigned the wrong season. I
have pasted the nuts and bolts of the code below:
Private Sub ADDBIOL_SEASON()
Dim cnnMM As ADODB.Connection, rstmm As ADODB.Recordset
Dim strDay As Date
Set cnnMM = Application.CurrentProject.Connection
Set rstmm = New ADODB.Recordset
rstmm.Open Source:="Sheet1", ActiveConnection:=cnnMM,
CursorType:=adOpenStatic, LockType:=adLockPessimistic
numrec = rstmm.RecordCount
rstmm.MoveFirst
For i = 0 To (numrec - 1)
If Not rstmm.Fields("Date").Value Then
strDay = rstmm.Fields("Date").Value
If strDay > "28-Nov-1981" And strDay < "27-Apr-1982" Then
rstmm.Fields("BIOL_SEASON").Value = "Wintering"
ElseIf strDay > "28-Nov-1982" And strDay < "27-Apr-1983" Then
rstmm.Fields("BIOL_SEASON").Value = "Wintering"