Here's a small routine to check the number of times a program has been run. You can put an if statement somewhere to terminate the program after some count. This method uses registry keys. You can try ini or a simpe txt or a mdb file.
Code:
Private Sub Form_Load()
Dim iCount As Integer
iCount = Val(GetSetting("SomeAppName", "SomeSectionName", "iCount", "1"))
MsgBox "You have run this program " & iCount & " times."
SaveSetting "SomeAppName", "SomeSectionName", "iCount", Str(iCount + 1)
End Sub
The registry key will be created in "HKEY_CURRENT_USER\Software\
VB and VBA Program Settings". If u want to avoid tampering by the users, you can create multiple keys and/or files and save the value in all of them, so if one of them is compromised you can have other copies. BUt if the user is determined, he can use simple tools to find out which files you are using. Nobody's safe.