Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows File Open 2

Status
Not open for further replies.

Crystalguru

Technical User
Oct 4, 2001
303
0
0
US
I would like to place a button on my form similar to the Windows Browse button. Letting the user browse for the .xls file on their computer. I have checked out this website, , although full of information, I am not a VB person and need further instruction.

I am trying to import a excel file into a Access table to verify accuracy of the data.

Thanks
crystalguru
 
Crystalguru,

Create a macro that has the following command in it.

Action: RunCommand
Command: Import

Then on your command button, put the name of the macro in the OnClick event.

That will bring up a browse window like you are looking for.

Chris
 
I knew this wasn't going to be easy....

Ok, here's what I have.
Macro - named it "Import"
Under the action column: RunCommand

In the properties of my button "Browse"
OnClick: Import

Is this right?

I click on the button and nothing happens.

crystalguru [flowerface]
 
Silly ole me. I see what I did wrong! After filling out the Action, there is a command dialogue box at the bottom of the screen. I had to look DOWN! goodness. This is much easier than all that code from the website.

thanks a bunch
crystalguru
 
I am trying to create a similar command button, but have not been as successul as Crystalguru.

In my inexperience with Access, I cannot see how to create the Macro that Krystoff recommends. Any thoughts would be much appreciated.
 
Disregard previous post. I solved it.

Thanks for the help, Krystoff
 
The macro way is the old one.
In the onClick event procedure of the button, simply add this line of code:
DoCmd.RunCommand acCmdImport

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
PHV -
Thanks for the update. Let me ask one more question.

I am trying to create a browse button that will allow users to open a Windows browse box to locate images. These images will then be stored in a text field. Upon saving the record, the file in the text field will be associated with an OLE field on a table.

In case this is an opaque description of the issue, let me illustrate with an example.

The form (Add Firm) allows users to imput 2 pieces of information - Firm Name and Firm Logo.

This matches with the table design for the Firms, in which I have three fields - Firm_ID, FirmName and FirmLogo (OLE Object field).

Let me know if you have any thoughts. Still working on this, but thought I would through the concept out to everyone.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top