[VBA ] 語法問題

看板Visual_Basic作者 (估計總是錯誤)時間15年前 (2011/03/13 21:05), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
Function ForNext(ByVal Min As Integer, ByVal Max As Integer, ByVal Bins As Integer) Dim TabName As String TabName = "tLimit" '設定暫存表單名稱 For Each obj In CurrentData.AllTables If TabName = obj.Name Then '如果暫存表單存在 CurrentDb.Execute "Drop Table tLimit;" '刪除暫存表單 Exit For End If Next obj CurrentDb.Execute "Create Table tLimit(Bins Int);" '產生暫存表單 For ForNext = Min To Max Step Bins CurrentDb.Execute "INSERT INTO tLimit VALUES(" + Str(ForNext) + ");" '新增資 料到暫存表單 Next CurrentDb.Execute "INSERT INTO tLimit VALUES(" + Str(ForNext) + ");" '新增資 料到暫存表單 End Function 這樣產生的TABLE是單欄 有辦法改成這樣嗎 EX: bin bin1 bin2 bin3 .......... 100 120 140 160 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.168.207.151
文章代碼(AID): #1DVC4juS (Visual_Basic)