okay i went ahead and set this up using the select case example above and try to do some calcuations with it by retrieving today's record and yesterday's record but i receive a run-time error saying the overflow of data. What did I do wrong and what can i do in order to fix this??
thanks.
============================================================
Option Explicit
Dim bValidTime As Boolean
Dim iDte As Integer
Dim iDate As Integer
Private Sub cmdNext_Click()
Dim vbResult As VbMsgBoxResult
Dim strSQL As String
If ValidData Then
strSQL = ""
strSQL = strSQL & " SELECT * "
strSQL = strSQL & " FROM edi_log"
rsLogAccess.Open strSQL, oConnAccess, adOpenDynamic, adLockOptimistic
If Not rsLogAccess.BOF Then
rsLogAccess.MoveFirst
End If
GetWEBEDIPOs
GetWEBEDIINVs
GetWeb_POs
GetWEB_Ven
rsLogAccess.Find "[time] = " & Date
If rsLogAccess.EOF Then
rsLogAccess.MoveLast
rsLogAccess.AddNew
rsLogAccess.Fields("time"

= Date
LoadData
Else
rsLogAccess.Update
LoadData
End If
Unload Me
frmLogResult.Show
End If
End Sub
Private Function LoadData()
strEDPO = txtEDPO.Text
rsLogAccess.Fields("edpo"

= Trim(strEDPO)
strLoadTime = txtLoadTime.Text
rsLogAccess.Fields("load"

= Trim(strLoadTime)
strXMITLoadTime = txtXMITLoadTime.Text
rsLogAccess.Fields("ordernet"

= Trim(strXMITLoadTime)
strIINGLoadTime = txtIingLoadTime.Text
rsLogAccess.Fields("iingout"

= Trim(strIINGLoadTime)
If txtComment.Text <> "" Then
strComment = txtComment.Text
rsLogAccess.Fields("comment"

= Trim(strComment)
End If
rsLogAccess.Fields("po"

= Trim(strPOs)
rsLogAccess.Fields("inv"

= Trim(strINVs)
rsLogAccess.Fields("WebP_POs"

= Trim(strProPO)
rsLogAccess.Fields("WebP_Ven"

= Trim(strProVen)
rsLogAccess.Fields("WebS_POs"

= Trim(strTestPO)
rsLogAccess.Fields("WebS_Ven"

= Trim(strTestVen)
CalculateMF
CalculateWebPO
rsLogAccess.Update
rsLogAccess.Close
End Function
Private Function CalculateMF()
iMf = 0
ValidDay
If Not rsLogAccess.BOF Then
rsLogAccess.MoveFirst
End If
If iDte = 0 Then
strMF = strEDPO
iMf = strEDPO
ElseIf iDte = 1 Then
rsLogAccess.Find "[time] = " & Date - 1
strMF = rsLogAccess("mf"

.Value + iMf
ElseIf iDte = 2 Then
ElseIf iDte = 3 Then
ElseIf iDte = 4 Then
End If
rsLogAccess.Fields("mf"

= Trim(strMF)
End Function
Private Function ValidDay()
Select Case Weekday(Date)
Case vbSunday
iDte = -1
MsgBox "Sunday no POs run!"
Case vbMonday
iDte = 0
iDate = Date
Case vbTuesday
iDte = 1
iDate = Date - 1
Case vbWednesday
iDte = 2
iDate = Date - 2
Case vbThursday
iDte = 3
iDate = Date - 3
Case vbFriday
iDte = 4
iDate = Date - 4
Case vbSaturday
iDte = 5
MsgBox "Saturday, no POs run!"
End Select
End Function