home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 May
/
W2KPRK.iso
/
apps
/
crystal
/
disk18
/
Xvb378._
/
Xvb378.
(
.txt
)
Wrap
Visual Basic Form
|
1999-08-23
|
8KB
|
247 lines
VERSION 5.00
Begin VB.Form frmOrdersDetail
BorderStyle = 3 'Fixed Dialog
Caption = "Orders Detail"
ClientHeight = 2085
ClientLeft = 240
ClientTop = 1185
ClientWidth = 6660
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2085
ScaleWidth = 6660
ShowInTaskbar = 0 'False
Tag = "Orders Detail"
Begin VB.CommandButton cmdClose
Cancel = -1 'True
Caption = "&Close"
Default = -1 'True
Height = 300
Left = 5520
TabIndex = 13
Top = 1340
Width = 975
End
Begin VB.CommandButton cmdGrid
Caption = "&Grid"
Height = 300
Left = 4440
TabIndex = 12
Tag = "&Grid"
Top = 1340
Width = 975
End
Begin VB.CommandButton cmdUpdate
Caption = "&Update"
Height = 300
Left = 3360
TabIndex = 11
Tag = "&Update"
Top = 1340
Width = 975
End
Begin VB.CommandButton cmdRefresh
Caption = "&Refresh"
Height = 300
Left = 2280
TabIndex = 10
Tag = "&Refresh"
Top = 1340
Width = 975
End
Begin VB.CommandButton cmdDelete
Caption = "&Delete"
Height = 300
Left = 1200
TabIndex = 9
Tag = "&Delete"
Top = 1340
Width = 975
End
Begin VB.CommandButton cmdAdd
Caption = "&Add"
Height = 300
Left = 120
TabIndex = 8
Tag = "&Add"
Top = 1340
Width = 975
End
Begin VB.Data Data1
Align = 2 'Align Bottom
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 'DefaultCursor
DefaultType = 2 'UseODBC
Exclusive = 0 'False
Height = 345
Left = 0
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "Orders Detail"
Top = 1740
Width = 6660
End
Begin VB.TextBox txtFields
DataField = "Quantity"
DataSource = "Data1"
Height = 285
Index = 3
Left = 2040
TabIndex = 7
Top = 1000
Width = 1935
End
Begin VB.TextBox txtFields
DataField = "Unit Price"
DataSource = "Data1"
Height = 285
Index = 2
Left = 2040
TabIndex = 5
Top = 680
Width = 1935
End
Begin VB.TextBox txtFields
DataField = "Product ID"
DataSource = "Data1"
Height = 285
Index = 1
Left = 2040
TabIndex = 3
Top = 360
Width = 1935
End
Begin VB.TextBox txtFields
DataField = "Order ID"
DataSource = "Data1"
Height = 285
Index = 0
Left = 2040
TabIndex = 1
Top = 40
Width = 1935
End
Begin VB.Label lblLabels
Caption = "Quantity:"
Height = 255
Index = 3
Left = 120
TabIndex = 6
Tag = "Quantity:"
Top = 1020
Width = 1815
End
Begin VB.Label lblLabels
Caption = "Unit Price:"
Height = 255
Index = 2
Left = 120
TabIndex = 4
Tag = "Unit Price:"
Top = 700
Width = 1815
End
Begin VB.Label lblLabels
Caption = "Product ID:"
Height = 255
Index = 1
Left = 120
TabIndex = 2
Tag = "Product ID:"
Top = 380
Width = 1815
End
Begin VB.Label lblLabels
Caption = "Order ID:"
Height = 255
Index = 0
Left = 120
TabIndex = 0
Tag = "Order ID:"
Top = 60
Width = 1815
End
Attribute VB_Name = "frmOrdersDetail"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdAdd_Click()
Data1.Recordset.AddNew
End Sub
Private Sub cmdClose_Click()
Me.Hide
End Sub
Private Sub cmdDelete_Click()
'this may produce an error if you delete the last
'record or the only record in the recordset
With Data1.Recordset
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
End Sub
Private Sub cmdRefresh_Click()
'this is really only needed for multi user apps
Data1.Refresh
End Sub
Private Sub cmdUpdate_Click()
Data1.UpdateRecord
Data1.Recordset.Bookmark = Data1.Recordset.LastModified
End Sub
Private Sub cmdGrid_Click()
On Error GoTo cmdGrid_ClickErr
Dim f As New frmDataGrid
Set f.Data1.Recordset = Data1.Recordset
f.Caption = Me.Caption & " Grid"
f.Show
Exit Sub
cmdGrid_ClickErr:
End Sub
Private Sub Data1_Error(DataErr As Integer, Response As Integer)
'This is where you would put error handling code
'If you want to ignore errors, comment out the next line
'If you want to trap them, add code here to handle them
MsgBox "Data error event hit err:" & Error$(DataErr)
Response = 0 'throw away the error
End Sub
Private Sub Data1_Reposition()
Screen.MousePointer = vbDefault
On Error Resume Next
'This will display the current record position
'for dynasets and snapshots
Data1.Caption = "Record: " & (Data1.Recordset.AbsolutePosition + 1)
'for the table object you must set the index property when
'the recordset gets created and use the following line
'Data1.Caption = "Record: " & (Data1.Recordset.RecordCount * (Data1.Recordset.PercentPosition * 0.01)) + 1
End Sub
Private Sub Data1_Validate(Action As Integer, Save As Integer)
'This is where you put validation code
'This event gets called when the following actions occur
Select Case Action
Case vbDataActionMoveFirst
Case vbDataActionMovePrevious
Case vbDataActionMoveNext
Case vbDataActionMoveLast
Case vbDataActionAddNew
Case vbDataActionUpdate
Case vbDataActionDelete
Case vbDataActionFind
Case vbDataActionBookmark
Case vbDataActionClose
Screen.MousePointer = vbDefault
End Select
Screen.MousePointer = vbHourglass
End Sub
Private Sub Form_Load()
Center Me
Me.Data1.DatabaseName = frmMain.gsDatabase
End Sub
Private Sub Form_Unload(Cancel As Integer)
Screen.MousePointer = vbDefault
End Sub