Hi guys, thanks for all the help recently!
I have a button on a form that imports a file, and another that runs a load of queries on a named table.
What I want to be able to do is automatically rename the file that is imported to 'tbl_full' so that the queries then have something to work on.
The problem is that the file imported will not always have the same filename. However the first two letters will be the same.
Perhaps there is a way to use sql 'LIKE' or similar?
---
OR
----
This needs to go into the onclick command for a button.. eg:
bold = what i want, italic = what i have.
Private Sub cmdImport_Click()
dim name as string
On Error Resume Next
'open import file dialog box
DoCmd.RunCommand acCmdImport = name
table with name = name becomes tbl_full
End Sub
I have a button on a form that imports a file, and another that runs a load of queries on a named table.
What I want to be able to do is automatically rename the file that is imported to 'tbl_full' so that the queries then have something to work on.
The problem is that the file imported will not always have the same filename. However the first two letters will be the same.
Perhaps there is a way to use sql 'LIKE' or similar?
---
OR
----
This needs to go into the onclick command for a button.. eg:
bold = what i want, italic = what i have.
Private Sub cmdImport_Click()
dim name as string
On Error Resume Next
'open import file dialog box
DoCmd.RunCommand acCmdImport = name
table with name = name becomes tbl_full
End Sub