473,657 Members | 2,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with Open Dialog Box

4 New Member
Hi Friends

I am trying to design a form where i need to browse a excel file using a open dialog box & append the same in a Table at the database.Any how i have taken care that the Table fields are in same order as the Excel file does.

Please have a look at the below codes which i used to open a "Open Dialog Box" which is working fine.

Now i want that when ever i select the File & click open the data in the file should get updated to the existing table deleting the existing data.

Can any one help me out in this regard.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command4_Click()
  2. Dim strFilter As String
  3.    Dim strInputFileName As String
  4.     strFilter = ahtAddFilterItem(strFilter, "all Files (*.*)", "*.*")
  5.  
  6.     strInputFileName = ahtCommonFileOpenSave( _
  7.                             Filter:=strFilter, _
  8.                             OpenFile:=True, _
  9.                             DialogTitle:="Choose a file...", _
  10.                             Flags:=ahtOFN_HIDEREADONLY)
  11. End Sub
Appreciate your help
Thanks
Manoj Kumar
Feb 11 '09 #1
4 1719
NeoPa
32,568 Recognized Expert Moderator MVP
Hi,

I moved your question to the correct forum and edited the title for the typo.

What is not clear from the question is which application the code is running in. Access or Excel?
Feb 12 '09 #2
ChipR
1,287 Recognized Expert Top Contributor
Take a look at DoCmd.TransferS preadsheet Method.
Feb 12 '09 #3
manojspromantr
4 New Member
Thanks for your reply.

This works if i specify the file name. Is there a way to import any excel file with any name.

Now i need to give a specific file name. What if i change the file name & fiels are same as per the Table. do i need to go each & every time & change the file name in the codes.


Thanks
Manoj Kumar
Feb 13 '09 #4
NeoPa
32,568 Recognized Expert Moderator MVP
@manojspromantr
No. The filename can be provided to the procedure either as a string literal or as a variable.

Post in you currently working (and compiled) code, and we can look at explaining in context.
Feb 13 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2314
by: a_rybicki | last post by:
"Hi - I'm experiencing something strange when I call a FileOpenDialog from a dialog box in my application (Borland C++ 6). Basically, here's the scenario: - Open my own child dialog from the main window. - Click on a "browse" button to open the FileOpen dialog. My dialog allocates the TData and TFileOpenDialog and then Execute()'s it.
1
2399
by: Steven | last post by:
Hello, I have a problem in using TreeView. I have made a dialog with TreeView. When I open this dialog , the Drives in the computer could be show in this TreeView.This time, I click the node of directory and get into the directory of "my Directory", then , I close the dialog. Next time, when I open the dialog again, I hope the directory that I have accessed before could be opened automatically. Just like this:
5
1785
by: Eric Twietmeyer | last post by:
Hi, Does anyone know why starting with VS.NET 2002 (and same with 2003) it is no longer possible to browse to a directory that has "ept" as part of the path? It worked fine in Vc 6.x. My initials and user name happen to be "ept", and so I have directories with that name. It is no longer possible to browse to any subfolder and therefore open any file under an "ept" directory. I can browse to such a folder using explorer and then drag a...
3
1199
by: Matt Osborn | last post by:
For a project containing help; set the resource.hm file attributes to include read only. Uncheck Tools->Options->Environment->Documents->Edit read only files. Open Project Open Resource View In Resource View, expand project.rc Expand dialog Notice that all dialog IDs have been replaced with the ID number rather than the defined name.
2
1659
by: Ken Varn | last post by:
I have an ASP.NET page that incorporates the following code on a button press. private void DownloadTag_Command(object sender, CommandEventArgs e) { FileStream fs; String Filename; Filename = MapPath(e.CommandArgument as string); // Name of file is passed in cmd arg.
2
6135
by: Mattbooty | last post by:
Hello, Not sure if anyone else has seen this bug, but I have a form where the entire form is covered with a picturebox. The picturebox has a mouseup event. I also have an open file dialog for loading images into the picturebox. If you double click the file you want to open in the open file dialog, it somehow interperets one of the clicks as a mouseup on the picturebox and fires the mouseup event for the picturebox. How can I get...
6
2693
by: Michael Groeger | last post by:
Hi, I have an aspx page which generates an excel document and transfers it to the browser as attachment. Normally, once the document is transferred the open save dialog prompts to open or save the excel document. When I click save I can save the excel document or when I click open it directly opens in excel. This works fine for all but one machine. On one machine however the dialog prompts to open or save the excel document (e.g....
2
2922
by: between | last post by:
Hello everyone, I have an intermediate understanding of Flash and currently work with Flash MX. My problem is this. I am creating a digital portfolio to be published as a Projector (.exe) to be distributed on disc to firms I wish to work for. I want the user to click on the button I have created for a specific image/work I have completed and have a seperate Projector open displaying said image. I have accomplished this partly, yet a dialog box...
5
6194
by: Stefano Tonello | last post by:
Hi all, I need to call windows' "open with" dialog from my C# windows form application. After the user selects application, control must return to me (I have to launch directly the process). I found this solution: http://www.codeproject.com/KB/shell/openwith.aspx but it's not good for me since it will execute the process directly.
14
4270
by: strat18 | last post by:
My database code works on my server and one laptop, but does not function correctly on two other laptops, all four systems run Vista Business and MSaccess 2007. The code is set up to display the file path in the open dialog file name box, that way the user clicks a button on a form, the open dialog box pops up, and the user just hits enter to open the file (the only reason the dialog box pops up is if the user wants to open a different file)...
0
8385
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8821
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8723
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8602
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.