• 主页

# 请问如何实现这样的功能？？

...全文
80 点赞 收藏 9

9 条回复

ABCatai 2004-11-10

Private Sub Fgrid1_DblClick()
If Fgrid1.Col = 3 Then
Select Case Fgrid1.Row
Case 1
If Fgrid1.Text = "" Then
Fgrid1.Text = "参选"
s(1) = "151"
x = x + 1
Else
Fgrid1.Text = ""
s(1) = ""
x = x - 1
End If
Case 2
If Fgrid1.Text = "" Then
Fgrid1.Text = "参选"
s(2) = "152"
x = x + 1
Else
Fgrid1.Text = ""
s(2) = ""
x = x - 1
End If
Case 3
If Fgrid1.Text = "" Then
Fgrid1.Text = "参选"
s(3) = "121"
x = x + 1
Else
Fgrid1.Text = ""
s(3) = ""
x = x - 1
End If
Case 4
If Fgrid1.Text = "" Then
Fgrid1.Text = "参选"
s(4) = "122"
x = x + 1
Else
Fgrid1.Text = ""
s(4) = ""
x = x - 1
End If
End Select
StatusBar1.Panels.Item(1) = "参选班级：027" & s(1) & " " & s(2) & " " & s(3) & " " & s(4)
End If
End Sub

xiaoxiaoP 2004-10-27

Private Sub MSFlexGrid1_DblClick(Index As Integer)
Select Case Index
Case 0
I = MSFlexGrid1(2).Rows
If MSFlexGrid1(0).row = 0 Then Exit Sub
If Trim(MSFlexGrid1(0).TextArray(MSFlexGrid1(0).Cols * MSFlexGrid1(0).row + 1)) = "" Then Exit Sub
MSFlexGrid1(2).Rows = I + 1
MSFlexGrid1(2).TextArray(I * 3 + 0) = "-"
MSFlexGrid1(2).TextArray(I * 3 + 1) = MSFlexGrid1(0).TextArray(MSFlexGrid1(0).Cols * MSFlexGrid1(0).row + 1)
MSFlexGrid1(2).TextArray(I * 3 + 2) = MSFlexGrid1(0).TextArray(MSFlexGrid1(0).Cols * MSFlexGrid1(0).row + 2)
Frame1(2).Caption = "准备加"
Frame1(2).ForeColor = &H8000&

Case 1
I = MSFlexGrid1(2).Rows
If MSFlexGrid1(1).row = 0 Then Exit Sub
If Trim(MSFlexGrid1(1).TextArray(MSFlexGrid1(1).Cols * MSFlexGrid1(1).row + 1)) = "" Then Exit Sub
MSFlexGrid1(2).Rows = I + 1
MSFlexGrid1(2).TextArray(I * 3 + 0) = "-"
MSFlexGrid1(2).TextArray(I * 3 + 1) = MSFlexGrid1(1).TextArray(MSFlexGrid1(1).Cols * MSFlexGrid1(1).row + 1)
MSFlexGrid1(2).TextArray(I * 3 + 2) = MSFlexGrid1(1).TextArray(MSFlexGrid1(1).Cols * MSFlexGrid1(1).row + 2)
Frame1(2).Caption = "准备取消"
Frame1(2).ForeColor = &HFF&

Case 2
j = MSFlexGrid1(2).Rows
k = MSFlexGrid1(2).row
If Trim(MSFlexGrid1(1).TextArray(MSFlexGrid1(2).Cols * MSFlexGrid1(2).row + 1)) = "" Then Exit Sub
If k = 0 Then Exit Sub
For jFor = k * 3 To (j - 1) * 3 - 1
MSFlexGrid1(2).TextArray(jFor) = MSFlexGrid1(2).TextArray(jFor + 3)
Next jFor
MSFlexGrid1(2).Rows = j - 1

End Select
End Sub

creazyfish 2004-10-27

creazyfish 2004-10-27

Dim mysql As String
Dim strcon As String

Private Sub Command1_Click()
With rs2
.Fields(0).Value = rs1.Fields(0).Value
.Fields(1).Value = rs1.Fields(1).Value
.Fields(2).Value = rs1.Fields(2).Value
.Fields(3).Value = rs1.Fields(3).Value
.Update
End With
With rs1
.Update
End With
Me.Grid1.DataSource = rs1
Me.Grid1.DataSource = rs2
End Sub

strcon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\PER\Programe\demo\2\Attendance.mdb;Persist Security Info=False"

mysql = "select * from Employee"

con.Open strcon

With rs1
End With

With rs2
.Open , , 1, 3
End With

Set rs1 = rs

Set Me.Grid1.DataSource = rs1
Grid1.Refresh

Set Me.Grid2.DataSource = rs2
Grid2.Refresh

End Sub

ABCatai 2004-10-27

creazyfish 2004-10-27

creazyfish 2004-10-26

cpio 2004-10-26

1180

VB 数据库(包含打印，安装，报表)