Advertisement
Advertisement
| 06.18.2008 at 04:04AM PDT, ID: 23494692 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: |
Private Sub Frame380_Click()
Dim str_sql1 As String
If Me.Frame380.Value = 1 Then
Label478.Caption = "Fall"
Label612.Caption = "Fall"
Label616.Caption = "Fall"
Label617.Caption = "Fall"
str_sql1 = "Update tblCycle Set Fall = 1"
DoCmd.RunSQL (str_sql1)
Else
Label478.Caption = "Spring"
Label612.Caption = "Spring"
Label616.Caption = "Spring"
Label617.Caption = "Spring"
str_sql1 = "Update tblCycle Set Fall = 2"
DoCmd.RunSQL (str_sql1)
End If
End Sub
-----------------------------------
Private Sub Frame380_AfterUpdate()
Dim str_sql As String
Dim str_ToFall As String
Dim str_ToSpring As String
Dim tname As String
Set cn = New ADODB.Recordset
str_ToFall = "From Spring To Fall"
str_ToSpring = "From Fall To Spring"
cn.ActiveConnection = CurrentProject.Connection
cn.CursorType = adOpenStatic
cn.CursorLocation = adUseServer
cn.LockType = adLockReadOnly
DoCmd.Hourglass True
dteToday = Format(Now(), "mm/dd/yyyy")
strUserName = fOSUserName
Dim str_sql1 As String
Me.cmbOffice = " "
Me.cmbCustomer = " "
DeleteACSE
Me.cmbOffice.Requery
Me.cmbCustomer.Requery
If Me.Frame380.Value = 1 Then
str_sql = "INSERT INTO tblCycleUpdate values ('" & strUserName & "', getdate(),'" & str_ToFall & "')"
DoCmd.RunSQL (str_sql)
tname = "tblBranchFallExcl" & Format(Date, "yymmdd")
CurrentProject.Connection.Execute "IF OBJECT_ID('" & tname & "') IS NOT NULL DROP TABLE " & tname
str_sql = "Select * INTO dbo.tblBranchFallExcl" & Format(Date, "yymmdd") & " FROM tblBranchFallExcl"
DoCmd.RunSQL (str_sql)
str_sql = "If Exists(SELECT * FROM dbo.SYSOBJECTS WHERE NAME = 'tblBranchFallExcl' AND TYPE = 'U') DELETE FROM tblBranchFallExcl"
DoCmd.RunSQL (str_sql)
lstBranchAll.RowSource = "Select Distinct Left([CPS Account Number],3) from tblFLLNExp where Left([CPS Account Number],3) not in (select branch from tblBranchFallExcl) order by Left([CPS Account Number],3)"
lstBranchExcl.RowSource = "Select Distinct Branch from tblBranchFallExcl order by Branch"
lstBranchAll.Requery
lstBranchExcl.Requery
Else
str_sql = "INSERT INTO tblCycleUpdate values ('" & strUserName & "', getdate(),'" & str_ToSpring & "')"
DoCmd.RunSQL (str_sql)
tname = "tblBranchSpringExcl" & Format(Date, "yymmdd")
CurrentProject.Connection.Execute "IF OBJECT_ID('" & tname & "') IS NOT NULL DROP TABLE " & tname
str_sql = "Select * INTO dbo.tblBranchSpringExcl" & Format(Date, "yymmdd") & " FROM tblBranchSpringExcl"
DoCmd.RunSQL (str_sql)
str_sql = "If Exists(SELECT * FROM dbo.SYSOBJECTS WHERE NAME = 'tblBranchSpringExcl' AND TYPE = 'U') DELETE FROM tblBranchSpringExcl"
DoCmd.RunSQL (str_sql)
lstBranchAll.RowSource = "Select Distinct Left([CPS Account Number],3) from tblSpLNExp where Left([CPS Account Number],3) not in (select branch from tblBranchSpringExcl) order by Left([CPS Account Number],3)"
lstBranchExcl.RowSource = "Select Distinct Branch from tblBranchSpringExcl order by Branch"
lstBranchAll.Requery
lstBranchExcl.Requery
End If
End Sub
|