Tuesday, September 07, 2004
Functions With Names Beginning With Q and R
There is only one VBA function with a name beginning with the letter ‘Q’, the QBColor() function. Most of us will probably never have occasion to use this function in a query, but if the occasion ever arises, you can rest assured that it works! :-)
The list of VBA functions with names beginning with the letter ‘R’ is a lot longer: Rate, Replace, RGB, Right, Right$, RightB, RightB$, Rnd, Round, RTrim, and RTrim$.
All of these functions executed without error in a query executed within the Microsoft Access environment. Here’s the SQL for the query that worked with Microsoft Access:
SELECT
QBColor([TestByte]) AS TestQBColor,
Rate([TestDouble1],-[TestDouble2],[TestDouble3]) AS TestRate,
Replace([TestText],"e","x") AS TestReplace,
RGB([TestByte],[TestInteger],[TestLong]) AS TestRGB,
Right([TestText],3) AS TestRight,
Right$([TestText],3) AS TestRightS,
RightB([TestText],3) AS TestRightB,
RightB$([TestText],3) AS TestRightBS,
Rnd([TestByte]) AS TestRnd,
Round([TestDouble],2) AS TestRound,
RTrim([TestText]) AS TestRTrim,
RTrim$([TestText]) AS TestRTrimS
FROM tblTestWITH OWNERACCESS OPTION;
Just one function, the Replace function, failed when the query was executed outside of the Microsoft Access environment, via our C# ‘JetTest’ utility (see earlier posts). The removal of that column enabled the query to execute without error via ‘JetTest’ also. So we can now add the following functions to our list of VBA functions that can be used in Jet queries executed outside of the Microsoft Access environment:
QBColor, Rate, RGB, Right, Right$, RightB, RightB$, Rnd, Round, RTrim, and RTrim$.
Send feedback on this post to (change the obvious):
Brendan Reynolds
bwnnfb at hotmail dot com
(For the insatiably curious, "bwnnfb" is an acronym for "Blog With No Name Feed-Back")
Copyright © 2004 Brendan Reynolds. All rights reserved.