home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form OrderHistory
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- Caption = "Order History"
- ClientHeight = 4635
- ClientLeft = -45
- ClientTop = 660
- ClientWidth = 6360
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 5040
- Left = -105
- LinkTopic = "Form1"
- ScaleHeight = 4635
- ScaleWidth = 6360
- Top = 315
- Width = 6480
- Begin VB.CommandButton Command1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Delete"
- Height = 615
- Left = 480
- TabIndex = 2
- Top = 3600
- Width = 1215
- End
- Begin VB.Data CustProdHist
- Appearance = 0 'Flat
- Caption = "CustProdHist"
- Connect = ""
- DatabaseName = "C:\VBPROJ\SAMS\VB4DB.MDB"
- Exclusive = 0 'False
- Height = 270
- Left = 1920
- Options = 0
- ReadOnly = 0 'False
- RecordsetType = 1 'Dynaset
- RecordSource = "CustProdHist"
- Top = 3840
- Visible = 0 'False
- Width = 2535
- End
- Begin MSDBGrid.DBGrid OrderHistoryGrid
- Bindings = "ORDRHIST.frx":0000
- Height = 2055
- Left = 360
- OleObjectBlob = "ORDRHIST.frx":0015
- TabIndex = 7
- Top = 240
- Width = 4935
- End
- Begin Threed.SSPanel Panel3D1
- Height = 1095
- Left = 360
- TabIndex = 3
- Top = 2400
- Width = 5655
- _version = 65536
- _extentx = 9975
- _extenty = 1931
- _stockprops = 15
- bevelwidth = 3
- borderwidth = 0
- Begin VB.TextBox dblAddQty
- Height = 285
- Left = 3600
- TabIndex = 6
- Top = 240
- Width = 735
- End
- Begin VB.TextBox txtAddDesc
- Height = 285
- Left = 1440
- TabIndex = 5
- Top = 240
- Width = 2175
- End
- Begin VB.TextBox txtAddDate
- Height = 285
- Left = 120
- TabIndex = 4
- Top = 240
- Width = 1335
- End
- Begin VB.Label Label1
- Caption = "To add an order, enter data into the fields and press ""Add"""
- Height = 255
- Left = 240
- TabIndex = 8
- Top = 720
- Width = 5175
- End
- Begin Threed.SSCommand Command3D1
- Height = 495
- Left = 4560
- TabIndex = 0
- Top = 120
- Width = 855
- _version = 65536
- _extentx = 1508
- _extenty = 873
- _stockprops = 78
- caption = "&Add"
- forecolor = 0
- End
- End
- Begin Threed.SSCommand btnDelTickets
- Height = 615
- Left = 4680
- TabIndex = 1
- Top = 3600
- Width = 1215
- _version = 65536
- _extentx = 2143
- _extenty = 1085
- _stockprops = 78
- caption = "&Close"
- forecolor = 0
- End
- Attribute VB_Name = "OrderHistory"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub btnDelTickets_Click()
- Unload OrderHistory
- End Sub
- Private Sub Command1_Click()
- Dim response
- response = MsgBox("Delete Order history entry?", 4, "Delete Record")
- If (response = vbNo) Then
- OrderHistoryGrid.SetFocus
- Exit Sub
- End If
- On Error GoTo delerror
- OrderHistoryGrid.SetFocus
- 'CustProdHist.Refresh
- If CustProdHist.Recordset.RecordCount = 0 Then Exit Sub
- CustProdHist.Recordset.DELETE
- OrderHistoryGrid.Refresh
- CustProdHist.Refresh
- Exit Sub
- delerror:
- OrderHistoryGrid.Refresh
- CustProdHist.Refresh
- Exit Sub
- End Sub
- Private Sub Command3D1_Click()
- Dim buffer As String
- Call UpdateCustProdHistRec
- buffer = "Select * From CustProdHist Where CustomerNum = " & Str(Customer_number)
- buffer = buffer & " Order By Date_Delivered DESC;"
- CustProdHist.RecordSource = buffer
- CustProdHist.Refresh
- OrderHistoryGrid.Refresh
- End Sub
- Private Sub dblAddQty_KeyPress(KeyAscii As Integer)
- ' While not a Windows standard, the client
- ' prefers to use the enter key to move from field to field.
- ' This subroutine should trap the keypress and
- ' and process all "ENTER" keys as "TAB"
- If KeyAscii = 13 Then
- SendKeys "{tab}"
- KeyAscii = 0
- End If
- End Sub
- Private Sub Form_Activate()
- ' Reset to the default pointer when returning to this form.
- MousePointer = 0
- Dim buffer As String
- buffer = "Select * From CustProdHist Where CustomerNum = " & Str(Customer_number)
- buffer = buffer & " Order By Date_Delivered DESC;"
- CustProdHist.RecordSource = buffer
- CustProdHist.Refresh
- OrderHistoryGrid.Refresh
- End Sub
- Private Sub Form_KeyPress(KeyAscii As Integer)
- ' While not a Windows standard, the client
- ' prefers to use the enter key to move from field to field.
- ' This subroutine should trap the keypress and
- ' and process all "ENTER" keys as "TAB"
- If KeyAscii = 13 Then
- SendKeys "{tab}"
- KeyAscii = 0
- End If
- End Sub
- Private Sub Form_Load()
- 'Center the form
- Left = (Screen.Width - Width) / 2
- TOP = (Screen.Height - Height) / 2
- End Sub
- Private Sub OrderHistoryGrid_GotFocus()
- 'If (CustProdHist.Recordset.RecordCount = 0) Then
- ' ' The following DoEvents is necessary.
- ' DoEvents
- ' CustProdHist.Recordset.AddNew
- ' CustProdHist.Recordset.Fields("CustomerNum") = Customer_number
- ' CustProdHist.Recordset.Update
- 'End If
- End Sub
- Private Sub Timer1_Timer()
- OrderHistoryGrid.Refresh
- End Sub
- Private Sub txtAddDate_KeyPress(KeyAscii As Integer)
- ' While not a Windows standard, the client
- ' prefers to use the enter key to move from field to field.
- ' This subroutine should trap the keypress and
- ' and process all "ENTER" keys as "TAB"
- If KeyAscii = 13 Then
- SendKeys "{tab}"
- KeyAscii = 0
- End If
- End Sub
- Private Sub txtAddDate_LostFocus()
- Dim datecheck
- datecheck = Format(txtAddDate.TEXT, "mm/dd/yy")
- End Sub
- Private Sub UpdateCustProdHistRec()
- Dim SQLUpdateTable
- Dim CustProdHistTbl As TABLE
-
- Set CustProdHistTbl = CustDB.OpenTable("CustProdHist")
- CustProdHistTbl.AddNew
- CustProdHistTbl.Fields("OrderNum") = 0
- CustProdHistTbl.Fields("CustomerNum") = Customer_number
- CustProdHistTbl.Fields("Date_Delivered") = Format(txtAddDate.TEXT, "mm/dd/yy")
- CustProdHistTbl.Fields("product") = txtAddDesc.TEXT
- CustProdHistTbl.Fields("Qty") = dblAddQty.TEXT
- CustProdHistTbl.UPDATE
- txtAddDesc.TEXT = ""
- dblAddQty.TEXT = ""
- txtAddDate.TEXT = ""
- End Sub
-