|
すみません。
貼り付け忘れていた物がありました。
全て標準モジュール
Function TBLName_dist(Dbs As DAO.Database) As Variant
Dim TB() As String, i As Long, ii As Long
For i = 0 To Dbs.TableDefs.Count - 1
If Left(Dbs.TableDefs(i).Name, 4) <> "MSys" Then
ii = ii + 1
ReDim Preserve TB(1 To ii)
TB(ii) = Dbs.TableDefs(i).Name
End If
Next i
If ii = 0 Then
TBLName_dist = Empty
Else
TBLName_dist = TB
End If
End Function
Function TBLE選択(TbNm_F As Variant) As String
Dim List_Tb() As String, i As Long
Dim TbTb As Variant, No As Long
For i = 1 To UBound(TbNm_F)
If Left(TbNm_F(i), 4) <> "MSys" Then
No = No + 1
ReDim Preserve List_Tb(1 To No)
List_Tb(No) = TbNm_F(i)
End If
Next
With UserForm1
.ListBox1.List = List_Tb
.Show
If .ListBox1.ListIndex >= 0 Then
TBLE選択 = .ListBox1.List(.ListBox1.ListIndex)
Else
TBLE選択 = Empty
End If
'Unload .ListBox1.Parent
End With
End Function
|
|