The examples are not VBScript. They are VBA. VBScript and VBA are both separate languages with different abilities. They are both based on VB and have a lot of similarities also. VBScript is more like a super batch file language. You can just type instructions in a text file and execute the text file.
To reference a userdefined VBA function in Access SQL, nothing special is needed. Access SQL will recognize standard SQL functions, standard VBA functions, and user created VBA functions located in the database from which the SQL is run.
You can do simple formatting in a query. If the formatting/calculation is more complex, you can create functions:
Select fld1, fld2, MyFunc(fld3) As Myfld3, Format(fld4, "mm/dd/yyyy") As Myfld4, ....
MyFunc() is a function defined by you. Format() is a standard VBA function. As you can see, there is no difference in the reference style.
"HardlyNoticable" <HardlyNoticable[ at ]discussions.microsoft.com> wrote in message news:7240F4C5-B07D-44E9-8536-07EECA1C8B1A[ at ]microsoft.com...
[Quoted Text] > Hi There, > > I'm trying to import data from a legacy database in to the database of the > new application that I am creating. I want to accomplish this by building > a > INTO query and will apply the query to convert the data over at launch > time, > ensuring that the new database is converted using the most current data. > > The new database uses a couple of different types to store data. Also, > there are a couple of columns where the data is stored with formatting > (telephone numbers) and I want to remove the formatting. I've seen a > couple > of examples of vbscript functions used within a query (eg. the age > functions > on this page: > http://support.microsoft.com/default.aspx?scid=kb;EN-US;290190)> and I think that this might be what I need to do this, but I have no idea > about how to create an Access Module or how to include it in a query and I > haven't been able to find a good tutorial. Could someone point me on the > path to salvation? > > Thanks, > hn.
|