• Hàm Kiểm tra sự tồn tại của 1 file trong Access
  • Hàm Kiểm tra sự tồn tại của 1 file trong Access

    Noname > 15-08-10, 01:20 PM

    Mã:
    Function FileExit(fname As String) As Boolean

        If Dir(fname) <> "" Then
        FileExit = True
        Else
        FileExit = False
        End If

        End Function



    Ví dụ: Ở sự kiện Load form của Form chính, bạn chọn cho code này vào:

    Mã:
    If not(FileExit("\\May2\DULIEU\LUU.MDB")) then
        msgbox " Phải cài file dữ liệu "
        docmd.quit
        End if