0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

テスト78

Last updated at Posted at 2022-12-03
Private Sub ファイル名_Click()
'事前にAccessのテーブルにハイパーリンク型でファイル名を入れておく
'フォームで表示されたファイル名をクリックすると、そのファイルが開く...((φ(゚ω゚ )メモメモ
Dim FSO As Variant
Dim Ex As Variant
Dim str_Path As String
Dim File_Path  As String

Set FSO = CreateObject("Scripting.FileSystemObject")
Set Ex = CreateObject("Excel.Application")

'フォルダパスを取得
str_Path = DLookup("フォルダパス", "T_テスト2")

'ファイルパスを作成
File_Path = FSO.BuildPath(str_Path, ファイル名.Text)

'Excelファイルを開く
Ex.workbooks.Open (File_Path)

'Excelファイルを表示する
Ex.Visible = True

Set Ex = Nothing
Set FSO = Nothing

MsgBox ファイル名.Text & "を開きました。", vbInformation, "ファイルを開く"

End Sub

'Accessのタブコントロールでタブを変える時に発生するイベント
'Form_タブフォーム内のイベント...((φ(゚ω゚ )メモメモ
Private Sub テスト1_Change()

MsgBox Me.テスト1.Pages(Me!テスト1.Value).Name

End Sub

''読み込み時にフォームの幅と高さを設定する
'Private Sub Form_Load()
'
'DoCmd.MoveSize , , 20 * 567, 10 * 567
'
'End Sub
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?