📄 frmstudentsmaster.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmStudentsMasterAdd
BackColor = &H80000013&
Caption = "Students Details"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
Icon = "frmStudentsMaster.frx":0000
LinkTopic = "Form1"
ScaleHeight = 12990
ScaleWidth = 21480
StartUpPosition = 3 'Windows Default
WindowState = 2 'Maximized
Begin VB.TextBox Text3
Height = 285
Left = 1320
TabIndex = 8
Text = "Text1"
Top = 5880
Width = 3255
End
Begin VB.TextBox Text2
Height = 285
Left = 1320
TabIndex = 6
Text = "Text1"
Top = 5520
Width = 3255
End
Begin VB.TextBox Text1
Height = 285
Left = 1320
TabIndex = 4
Text = "Text1"
Top = 5160
Width = 3255
End
Begin VB.Frame Frame1
BackColor = &H80000013&
Caption = "Existing Students"
Height = 4575
Left = 120
TabIndex = 0
Top = 240
Width = 21135
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 4095
Left = 120
TabIndex = 1
Top = 240
Width = 20775
_ExtentX = 36645
_ExtentY = 7223
_Version = 393216
BackColorBkg = -2147483629
End
End
Begin VB.Label Label5
Caption = "First Name"
Height = 255
Left = 120
TabIndex = 9
Top = 6360
Width = 1095
End
Begin VB.Label Label4
Caption = "Last Name"
Height = 255
Left = 120
TabIndex = 7
Top = 5880
Width = 1095
End
Begin VB.Label Label3
Caption = "Middle Name"
Height = 255
Left = 120
TabIndex = 5
Top = 5520
Width = 1095
End
Begin VB.Label Label2
Caption = "First Name"
Height = 255
Left = 120
TabIndex = 3
Top = 5160
Width = 1095
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "New Student Details"
Height = 255
Left = 120
TabIndex = 2
Top = 4920
Width = 1695
End
End
Attribute VB_Name = "frmStudentsMasterAdd"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim ws As Workspace
Dim db As Database
Dim rs As Recordset
Private Sub Form_Load()
Dim mcnt
mcnt = 0
Set ws = Workspaces(0)
Set db = ws.OpenDatabase(App.Path & "\database\SIRPOLDFormat.mdb")
Set rs = db.OpenRecordset("Select * from StudentMast", dbOpenDynaset)
MSFlexGrid1.Rows = 20
MSFlexGrid1.Cols = 6
'*-- Define Header
MSFlexGrid1.Row = 0
MSFlexGrid1.Col = 0
MSFlexGrid1.Text = "Sr.No"
MSFlexGrid1.Col = 1
MSFlexGrid1.Text = "First"
MSFlexGrid1.Col = 2
MSFlexGrid1.Text = "Middle"
MSFlexGrid1.Col = 3
MSFlexGrid1.Text = "Last"
MSFlexGrid1.Col = 4
MSFlexGrid1.Text = "ID"
MSFlexGrid1.Row = MSFlexGrid1.Row + 1
Do While Not rs.EOF()
If MSFlexGrid1.Row = 1 Then
MSFlexGrid1.CellBackColor = vbRed
End If
MSFlexGrid1.Col = 0
MSFlexGrid1.Text = Val(MSFlexGrid1.Row)
MSFlexGrid1.Col = 1
MSFlexGrid1.Text = rs(2)
MSFlexGrid1.Col = 2
MSFlexGrid1.Text = rs(3)
MSFlexGrid1.Col = 3
MSFlexGrid1.Text = rs(4)
MSFlexGrid1.Col = 4
MSFlexGrid1.Text = rs(1)
MSFlexGrid1.Row = MSFlexGrid1.Row + 1
mcnt = mcnt + 1
rs.MoveNext
Loop
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -