Check if dynamic array dimensioned already

Tells if a dynamic array has been dimensioned or not.Lu Original Author: Newsgroup Posting Code Function Member(ary$(), text$)  On Local Error GoTo MemberExit  For i = 1 To UBound(ary$)    If text$ = ary$(i) Then      subscript = i      Exit For    End If  NextMemberExit:  Member = subscript  End Function;========================================another possibility;Function ArrayElements(ary$())  elements = 0      On Local Error GoTo MemberExit  elements = UBound(ary$)MemberExit:  ArrayElements = elementsEnd Function

Create/Destroy User on Domain ( Administrating NT)

Create a new user and destroy an existing user on a Windows NT domain..When a user iscreated, I set him to be a member of Domain Users while you can specify that he goesinto Domain User, Domain Guests, Domain AdminsHong YAN Original Author: Newsgroup Posting API Declarations ‘Jeff Hong YAN 11/20/96 modified on 4/18/97‘This module shows how to create… Read More »

Get Win95/NT username

95/NT username“Joseph P. Fisher” Original Author: Newsgroup Posting API Declarations Declare Function GetUserName Lib “advapi32.dll” Alias “GetUserNameA” (ByVallpBuffer As String, nSize As Long) As Long Code gsUserId = ClipNull(GetUser()) Function GetUser() As String  Dim lpUserID As String  Dim nBuffer As Long  Dim Ret As Long    lpUserID = String(25, 0)  nBuffer = 25  Ret = GetUserName(lpUserID, nBuffer)  If Ret Then  GetUser$ = lpUserID$  End IfEnd Function  Function ClipNull(InString As String)… Read More »

Convert currency numbers into text

This function converts numbers (currency) to words including centconversion and cent rounding.Note: ms stores 4 decimal positions internally but displays only 2.In a lot of number to word functions this is not handled and can causeerroneous values… this function corrects for this situation.Baz, Original Author: Newsgroup Posting Assumptions Create a module and copy all the below functions intoit.To use:… Read More »

GetMonDate

Get the previous week’s Monday…”Kathleen A. Earley” Original Author: Newsgroup Posting Code Function GetMonDate (CurrentDate)  ‘checks to see if CurrentDate is a Date datatype  If VarType(CurrentDate) <> 7 Then    GetMonDate = Null  Else    Select Case Weekday(CurrentDate)      Case 1   ‘Sunday        GetMonDate = CurrentDate – 6      Case 2   ‘Monday        GetMonDate = CurrentDate      Case 3 To 7 ‘Tuesday..Saturday        GetMonDate = CurrentDate – Weekday(CurrentDate) + 2    End Select  End IfEnd Function

Get GUID string

Generates Global Unique ID – when you want to create an identifier which will never repeat all over the word , you will find this usefull. Original Author: Bogdan Chernyachuk Returns Returns Global Unique ID in string format (the same as the format of ClassID written in registry). API Declarations Public Type GUID ‘ a structure for Global Uniq.… Read More »

Build a Stateless Class

The example shows how to create a “Stateless” Class. By sending and receiving UDT’s and disconnected recordsets you will find a significant increase in speed with your objects in a 3 tiered application. If you use collections, each time you get/set a property you make a network call. This method reduces network traffic. Original Author: Mark Freni Inputs I… Read More »

CaptureWindows,CaptureForm,CaptureClient,etc…

Screen capture code. Original Author: StonePage API Declarations Option Explicit‘declares to disable PCPublic Const SPI_SCREENSAVERRUNNING = 97Declare Function SystemParametersInfo Lib “user32” Alias “SystemParametersInfoA” (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Boolean, ByVal fuWinIni As Long) As Long‘global variable for capture settingGlobal Setting As IntegerPrivate Type PALETTEENTRYpeRed As BytepeGreen As BytepeBlue As BytepeFlags As ByteEnd TypePrivate… Read More »

Text Box Auto Fill

This simple code allows to make an auto-filled textbox (like an adress box in IE). This example uses an DataEnvironment connection, but it can be easy used in any other cases. Original Author: Timur Assumptions Just place this code into the form module and correct the sub title (e.g. the textbox, which uses this code in my app is… Read More »

A function that encrypts/decrypts.

2 functions 1 that encrypts a passed variable(string) and the other decrypts the data(path of file)Mainly used for a single password.The code encrypts each character with a simple formula, the more characters the better the encryption.The limit on the password length is 50 characters. Original Author: m@llot Inputs The encrypt function input is the passed variable which is the… Read More »