|
請問高手,下拉框的值選不進去各位高手,請幫忙一下,我做了個數據導入的表單,裡面下拉框的值一直都可以選的,不知為什麼,
過了年來後下拉框中的值選不進去,好像被鎖定了一樣,我都沒動任何東西,也重新安裝OFFICE系統都不行
,請大俠幫我出出主意。謝謝
下面是源代碼,這個意思是從EXCEL不同sheet中導入到ACCESS相應表中,下拉框選擇的值為它們相對應的欄位。
Private Sub Frame_dy_AfterUpdate()
Dim str3 As String
Select Case Frame_dy.Value
Case 1
str3 = "SELECT tbl_extoacc_dy.id, tbl_extoacc_dy.mc, tbl_extoacc_dy.bh, tbl_extoacc_dy.dy, tbl_extoacc_dy.sbh FROM tbl_extoacc_dy WHERE (((tbl_extoacc_dy.sbh) = 1)) WITH OWNERACCESS OPTION;"
Me.Child4.Form.RecordSource = str3
'Set tbf = dbs.TableDefs("tbl_material_inout")
' fld = tbf.Fields.Count
' Set rec1 = dbs.OpenRecordset("tbl_extoacc_dy")
'For fld = 0 To tbf.Fields.Count - 1
' rec1.AddNew
' rec1("bh") = tbf.Fields(fld).Name 獲取字段名
' fld = fld + 1
' rec1.Update
' Next fld
Case 2
str3 = "SELECT tbl_extoacc_dy.id, tbl_extoacc_dy.mc, tbl_extoacc_dy.bh, tbl_extoacc_dy.dy, tbl_extoacc_dy.sbh FROM tbl_extoacc_dy WHERE (((tbl_extoacc_dy.sbh) = 2)) WITH OWNERACCESS OPTION;"
Me.Child4.Form.RecordSource = str3
Case 3
str3 = "SELECT tbl_extoacc_dy.id, tbl_extoacc_dy.mc, tbl_extoacc_dy.bh, tbl_extoacc_dy.dy, tbl_extoacc_dy.sbh FROM tbl_extoacc_dy WHERE (((tbl_extoacc_dy.sbh) = 3)) WITH OWNERACCESS OPTION;"
Me.Child4.Form.RecordSource = str3
Case 4
str3 = "SELECT tbl_extoacc_dy.id, tbl_extoacc_dy.mc, tbl_extoacc_dy.bh, tbl_extoacc_dy.dy, tbl_extoacc_dy.sbh FROM tbl_extoacc_dy WHERE (((tbl_extoacc_dy.sbh) = 4)) WITH OWNERACCESS OPTION;"
Me.Child4.Form.RecordSource = str3
End Select
End Sub
[ 本帖最后由 hepingwin 于 2008-2-22 12:27 编辑 ]
附件 a.JPG (51.41 KB) 2008-2-22 10:55
|
|