How can I trigger explorer in Access 2000

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Morning,

I have been tasked with writing a database which will allow a telesales team
to call up customers about certain promotions e.g. No Smoking.

In the database already is a master list of customers. Details of the
promotion data (i.e. Customer No..will be provided by another data supplier
in the form of a CSV file. What I would like to do, in simple terms, is for
the user to choose from a list of promotions in a list box. This will then
generate a list of all the customers associated with the promotion. Users
can then call customers and make notes against each promotion code.

Th way I see this working is for the user to choose an option that says add
New promotion...I would like Explorer to then be triggered allowing the user
to select a text file. Once a file has been selected...I would like Access
to link to the table and then ask the user for a promotion name e.g. No
Smoking Campaign. This will then, add a field to the master contacts list
with the field name being the index for the promotion.

Would someone mind giving me some snippet code on how,

- I could use explorer as an obect to select a file and link to it
- Add a new field to a table with a given name (Promotion Name)

Thank you in advance
 
Thanks Arvin,

I did not realise how difficult this would be. I have taken the time to
look at the API code but would not know where to start. I was hoping there
would be a nice simple routine to use. Thank any way
 
It actually is quite simple.

Copy all of the code between Code Start and Code End, paste it into a new
module, and save that module. (Make sure that the name of the module isn't
the same as any routines in the module)

Now, you need to add 4 lines of code to invoke the browser:

Dim strFilter As String
Dim strInputFileName as string

strFilter = ahtAddFilterItem(strFilter, "Text Files (*.csv)", "*.csv")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)

Those 4 lines will prompt the user to select a CSV file, and the full path
to the selected file will be returned in strInputFileName

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)
 
Thank you Douglas...for not simply dismissing my reply. I have added a
button a form which when pressed, launched explores and asks for a CSV file
which is exactly what I wanted.

Sorry to push my luck....but can you also tell me
once the file has been selected in explorer, how can that file then be
imported . Once I know that I can use my "dinasaur skills" to start writing
some queries

e.g. I user selects file Sean.CSV and selects open from explorer. How can
that file then be imported into Access. Once I know that...I can use my
"dinasaur skills" to start some query writing.

Thanks again.
 
Sorry I was too hasty to writ this. After look at some different threads I
found a suitbale answer using TransferText including adding a import
specification.

Thanks again, most appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top