谁有用vsflexgrid控件作为表格,大批量录入数据的例子? 谁有用vsflexgrid控件作为表格,大批量录入数据的例子?最好带有校验功能的,比如某列录入数据时该数据必须在另一个表中能查找到,否则不能跳出单元格 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 FindRow你看看这个属性,你的意思能不能说的具体点 那你不如用vsflexgrid的combolist属性让人选择好些,所能选择的只能是表中的数据 Private Sub Grid1_AfterEdit(ByVal Row As Long, ByVal Col As Long) '//變成已修改=================================================== Checkx = True '//單元格變換=================================================== Select Case Grid1.Col Case 2 '//自已輸入布料編號時================================ If Not (Me.ActiveControl Is Grid1) Then Exit Sub If Trim(Grid1.Cell(flexcpText, Row, Col)) <> "" Then If OpenDBase(Cloth_Cloth_QS3(Cloth_Cloth_SortxStr, "Cloth_Cloth_NO='" & Grid1.EditText & "'")) = False Then InputErrRow1 = Row InputErr1 = True If x_Rs.State = 1 Then x_Rs.Close Grid1.Select InputErrRow1, 2 Exit Sub End If If x_Rs.RecordCount = 0 Then InputErrRow1 = Row InputErr1 = True If x_Rs.State = 1 Then x_Rs.Close Grid1.Select InputErrRow1, 2 Xtxxts "布料資料庫中還未存在相關資料,請先輸入布料其本資料!", 0, 3 Exit Sub End If If x_Rs.RecordCount > 1 Then InputErrRow1 = Row InputErr1 = True If x_Rs.State = 1 Then x_Rs.Close Grid1.Select InputErrRow1, 2 Xtxxts "布料資料庫中存在多個相同布號!", 0, 3 Exit Sub End If Grid1.Cell(flexcpData, Grid1.Row, 2) = x_Rs.Fields("Cloth_Cloth_ID").Value Grid1.Cell(flexcpText, Grid1.Row, 3) = IIf(IsNull(x_Rs.Fields("Base_Color_NameC").Value), "", x_Rs.Fields("Base_Color_NameC").Value) Grid1.Cell(flexcpText, Grid1.Row, 4) = IIf(IsNull(x_Rs.Fields("Base_Color_Value").Value), "", x_Rs.Fields("Base_Color_Value").Value) Grid1.Cell(flexcpText, Grid1.Row, 20) = IIf(IsNull(x_Rs.Fields("Base_Unit_Name").Value), "", x_Rs.Fields("Base_Unit_Name").Value) Grid1.Cell(flexcpText, Grid1.Row, 22) = IIf(IsNull(x_Rs.Fields("Cloth_Cloth_FD").Value), "", x_Rs.Fields("Cloth_Cloth_FD").Value) Grid1.Cell(flexcpText, Grid1.Row, 27) = IIf(IsNull(x_Rs.Fields("Cloth_SM_Name1").Value), "", x_Rs.Fields("Cloth_SM_Name1").Value) InputErr1 = False Else Grid1.Cell(flexcpData, Grid1.Row, 2) = "" Grid1.Cell(flexcpText, Grid1.Row, 3) = "" Grid1.Cell(flexcpText, Grid1.Row, 4) = 16777215 '白色 Grid1.Cell(flexcpText, Grid1.Row, 20) = "" Grid1.Cell(flexcpText, Grid1.Row, 22) = "" Grid1.Cell(flexcpText, Grid1.Row, 27) = "" InputErr1 = False End If End SelectEnd SubPrivate Sub Grid1_EnterCell() '//網格單元格成為焦點時========================================= '//輸入錯誤的布料編號就死鎖在那個錯誤格========================= If InputErr1 = True And (InputErrRow1 <> Grid1.Row Or Grid1.Col <> 2) Then Grid1.Select InputErrRow1, 2 Grid1.ShowCell InputErrRow1, 2 Xtxxts "布料編號輸入錯誤!", 0, 3 End IfEnd Sub 踩到11111楼,圆我养鸡梦想 数据库更新不了 提示错误 高手来帮忙 关于ADO写法的问题,我解决不了了,求助. VB6能否实现隐藏本身程序的进程??(不是隐藏任务栏上的哦) ini文件的作用? 关于datareport在页注脚里的统计问题!不知怎么才能把rptFunction放到页注脚里! treeview想做到资源管理器的效果 winsock问题,高分相送 在VB中如何实现用sub main启动? 老规矩,生日发分!!! 为什么今天在公司发贴子的时候,报错:请不要发表可能给我们带来伤害的言论,谢谢配合
你的意思能不能说的具体点
'//變成已修改===================================================
Checkx = True
'//單元格變換===================================================
Select Case Grid1.Col
Case 2 '//自已輸入布料編號時================================
If Not (Me.ActiveControl Is Grid1) Then Exit Sub
If Trim(Grid1.Cell(flexcpText, Row, Col)) <> "" Then
If OpenDBase(Cloth_Cloth_QS3(Cloth_Cloth_SortxStr, "Cloth_Cloth_NO='" & Grid1.EditText & "'")) = False Then
InputErrRow1 = Row
InputErr1 = True
If x_Rs.State = 1 Then x_Rs.Close
Grid1.Select InputErrRow1, 2
Exit Sub
End If
If x_Rs.RecordCount = 0 Then
InputErrRow1 = Row
InputErr1 = True
If x_Rs.State = 1 Then x_Rs.Close
Grid1.Select InputErrRow1, 2
Xtxxts "布料資料庫中還未存在相關資料,請先輸入布料其本資料!", 0, 3
Exit Sub
End If
If x_Rs.RecordCount > 1 Then
InputErrRow1 = Row
InputErr1 = True
If x_Rs.State = 1 Then x_Rs.Close
Grid1.Select InputErrRow1, 2
Xtxxts "布料資料庫中存在多個相同布號!", 0, 3
Exit Sub
End If
Grid1.Cell(flexcpData, Grid1.Row, 2) = x_Rs.Fields("Cloth_Cloth_ID").Value
Grid1.Cell(flexcpText, Grid1.Row, 3) = IIf(IsNull(x_Rs.Fields("Base_Color_NameC").Value), "", x_Rs.Fields("Base_Color_NameC").Value)
Grid1.Cell(flexcpText, Grid1.Row, 4) = IIf(IsNull(x_Rs.Fields("Base_Color_Value").Value), "", x_Rs.Fields("Base_Color_Value").Value)
Grid1.Cell(flexcpText, Grid1.Row, 20) = IIf(IsNull(x_Rs.Fields("Base_Unit_Name").Value), "", x_Rs.Fields("Base_Unit_Name").Value)
Grid1.Cell(flexcpText, Grid1.Row, 22) = IIf(IsNull(x_Rs.Fields("Cloth_Cloth_FD").Value), "", x_Rs.Fields("Cloth_Cloth_FD").Value)
Grid1.Cell(flexcpText, Grid1.Row, 27) = IIf(IsNull(x_Rs.Fields("Cloth_SM_Name1").Value), "", x_Rs.Fields("Cloth_SM_Name1").Value)
InputErr1 = False
Else
Grid1.Cell(flexcpData, Grid1.Row, 2) = ""
Grid1.Cell(flexcpText, Grid1.Row, 3) = ""
Grid1.Cell(flexcpText, Grid1.Row, 4) = 16777215 '白色
Grid1.Cell(flexcpText, Grid1.Row, 20) = ""
Grid1.Cell(flexcpText, Grid1.Row, 22) = ""
Grid1.Cell(flexcpText, Grid1.Row, 27) = ""
InputErr1 = False
End If
End Select
End SubPrivate Sub Grid1_EnterCell()
'//網格單元格成為焦點時=========================================
'//輸入錯誤的布料編號就死鎖在那個錯誤格=========================
If InputErr1 = True And (InputErrRow1 <> Grid1.Row Or Grid1.Col <> 2) Then
Grid1.Select InputErrRow1, 2
Grid1.ShowCell InputErrRow1, 2
Xtxxts "布料編號輸入錯誤!", 0, 3
End If
End Sub