Referencing Tables

  • Thread starter Thread starter Glenn E. White
  • Start date Start date
G

Glenn E. White

Please help me! I am creating an SQL string to use in a
function. How do you reference a table is a string?

Below is a sample of my code:

Dim strFilePath, strFileName, strFileExt, strCallFile As
String

strFilePath = Tables![tblOne]![Field1]
strFileName = Forms![frmOne]![cboOne]
strFileExt = Tables![tblOne]![Field2]
strCallFile = strFilePath & strFileName & strFileExt

In addition, how can you open a multimedia file (.wav)
using the program that it is associated with in vba? Is
it possible.

Any help will be greatly appreciated.

Sincerely,
Glenn E. White
 
I'm afraid I can't figure out what you're trying to do in your first
question. Are you trying to retrieve a value from the table? If so, you
either have to open a recordset and refer to the appropriate field in the
recordset, or use the DLookup function.

For the second one, though, use the ShellExecute API call. There's sample
code at http://www.mvps.org/access/api/api0018.htm at "The Access Web"
 
Back
Top