Skip to main content

IDEAScript Questions

Indicex/index

I got a script to create an index, but IDEA don't set the index, the default is no index, is there a way to force IDEA to use a specific index?
 
 
Function IndexDatabase(DatabaseToBeOpened As String, FieldToBeIndexed As String, IndexKey As String)
Set db = Client.OpenDatabase(DatabaseToBeOpened)
Set task = db.Index
task.AddKey FieldToBeIndexed, IndexKey
task.Index FALSE
Client.CloseDatabase(DatabaseToBeOpened)
Set task = Nothing
Set db = Nothing
End Function

Using a global variable defined Macro script 1 and using the same variable value in Macro script2

Hi All & Brian,
I have a doubt regarding declaring a variable in one macro script and then using the variable's value defined by the end user in the first macro in the second macro. To give you more perspective this is the code i am working on:
 
Macro 1: 
Option Explicit
Global sFilename As String

Summarization

Hi, i created a piece of script in which all the parameters are set in the call line. Now i run into the problem that sometimes with the summarization function there a one or more fields to summarize or to total on. I could create an array outside the function and let i unpack within the function with For i to next. But is there a way to create the array within the call line?

Check if field exists

Hi, in the script of generate an audit number is a function to check if the fields exists.
http://ideascripting.com/ideascript/generate-audit-number
I want to use that function to create a indicator if the fields exists (variabele "Result"). To reset it at the start of the script I set it to unkown. I placed a line to set Result to "Exists" afters TempFieldname = sTempFieldname & "1". But i can't find the right place for the line Result = "Not exists". 

Set record number in a field

I got a bank transaction file in which only the bank statement number is a field. If i want to join this file with the administration i need to have the row/record number in a field so i can create a key field on which to join on. 
Question 1 is how can i create a field with the row number and question 2 is how do i make it that when the field with the bank statement number changes the row number starts with 1. In the perfect world it should looks like this:
Bank statement nr.      Row number

Array

Hi, i want to use the fieldsname which i placed in an array to check for each field if it is numeric or not. But for some reason it won't accept the array fieldname to get the field and check if it is numeric or not. Anyone who can help me?
 
------------------------------------------
 Option Explicit
 
Dim A1 As Integer
Dim A2 As Integer
Dim i As Integer
 
Dim DbLetter As String 
Dim Q1 As Integer
Dim Q2 As Integer
 
Dim db As database
Dim table As table

Fill blank fields

Hi Brian, is there a way to add text into an existing blank field, using a script. I've seen some scripts to fill down a column with the contents from the previous field, but i need to add new text to the blank fields.
 
For example, i have a database with various columns and 1000 records. In column X, 500 fields allready has text Q1, the other 500 fields are blank. In these blank fields I want to add Q2.
 
Thanks, Mike

compare dates

My name is Lucas and I'm from Argentina, I really like your blog.
 
I have a query, I'm doing a "macro" for IDEA with visual basic, where from a base I take a field that has a date in string format I convert it to date. Then I want the user to enter a date with which to compare that data previously obtained, in order to have the base already filtered.
 
Sorry for my english.
 
I have made the following script:
 
' File - Import Assistant: Delimited Text
 
Function Test
dbName = "E070.IMD"