Question : Lookup Multiple Records from a Form

I'd like to create a form which allows a user to enter multiple account numbers into a field or text box of some sort. Then run a query which looks up all the individual account numbers entered.

I was thinking of using the "IN" statement, but I can't figure out how to have the user enter the acct numbers. What sort of form item would I use to allow multiple items? The user should be able to enter just one, multiple, or copy/paste a list.

I image I need some sort of VBA to parse the input so that it matches the format for the IN statement ('ABC', 'DEF', 'GHI') etc. Ideally, the user can separate with commas or press enter in between each acct no.

Answer : Lookup Multiple Records from a Form

The simplest way to get the column headers into the CSV (unless using wildcard columns in the sql select) would be to add a line after line 10:

print OUT "col1,col2,col3\n"; # whatever columns you select in the sql at line 10

To get the column names programmatically is more difficult (eg I can't remember off the top of my head and will have to look it up).
Random Solutions  
 
programming4us programming4us