The following code will Export data to a CSV file. You can pass a Table name Query name, or an SQL statement to it. If you pass an SQL statement, be sure to wrap it with parenthesis. The procedure is declared as a Function for convenience and will always return a 0. The convenience being referenced, is that of adding the function call directly to that OnClick procedure of a Button control with something like this in the On Click property:
Continue reading
Category Archives: UtterAccess Archive
ExpandEnvironmentVariableString
Takes an input string containing environment variables %temp%, %username%, etc) and returns the same string with those variables expanded (e.g., resolved to their final value)
Continue reading
EvalMixedNum
This function is similar to the builtin Eval function, but instead returns the value of a mixed number (ex. 1-1/4). This is useful in situations where the user might be entering a size dimension into an unbound field, or other situations where a user may desire to enter a fractional value in an unbound field.
Continue reading
EqualGrouping
The function attempts to divide a given number of discrete items into equal groups and minimize the number of groups needed. This is useful for scenarios where you may want to avoid layouts where you have 4 items on first page and only 1 items on second page. Running 5 items for maximum of 4 through the function will return { 3, 2 }, enabling you to know that you’d put 3 items on one page and 2 on next page.
Continue reading
CloseDesignForms
Function to loop all open forms and, if they’re in design mode, close them. Default save behavior is to prompt for save.
Continue reading
CloseAllForms
Closes all open Form objects unless the name of the form has been passed to the function as an exclusion (you can pass multiple form names as being ‘Excluded’). Returns a byte value of 0. The reason for creating this procedure as a Function is that you have to ability to set the OnClick event of a button to: =CloseAllForms() and thus avoid a “one-liner” of [Event Procedure] VBA code to call the procedure.
Continue reading
ChangeFileExtension
Replaces extension with new one
Continue reading
BuildName
This function builds a name with the specified components. Particularly useful in queries.
Continue reading
BuildInClause
Build an In Clause from a ListBox
Continue reading
Base Ten to Base Letter
This is a pair of related functions for use in VBA. For alternate methods while working in Excel and within a limited range, see the Alternative Excel Implementation section.
Continue reading