[VBA ] 語法問題
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