473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with a GUi

41
I a new user of Access (I am learning to use it for an internship) and I have two questions which I can't find direct answers to. I am continuing to work on a GUI that had previously been prepared by the previous intern and I am finding it hard to pick it up.

1. There is a drop down menu with a list of different locations. When one is selected, then the GUI will proceed to graph all the related graphs for that location. What I need help with is there is an "All?" checkbox - the idea being that if I check that, the graphs for all the locations will be generated.

2. Saving the graphs. When the graphs are generated, there is a field to type in the file name the user would like. There is also a "Browse" button with no functionality associated with it yet - the idea for that is to browse the computer to pick the directory where the user would want to save the file. Any ideas for the code for that? I tried something that I found in another forum (I can't find the link right now) but it doesn't really work for me.

Again, I am a new user but any help would be really appreciated! Thanks in advance.

Carmen
Jul 9 '07 #1
9 2271
JKing
1,206 Expert 1GB
For your second question you can code a filedialog for the click event of your browse button to return the path of the selected directory. Here's the code:

Expand|Select|Wrap|Line Numbers
  1. Dim dlgGetFolder As FileDialog
  2. Dim strPath As String
  3.  
  4. Set dlgGetFolder = Application.FileDialog(msoFileDialogFolderPicker)
  5.  
  6. dlgGetFolder.Show
  7. strPath = dlgGetFolder.SelectedItems(1)
  8.  
As for your first question, I'm not sure I fully understand what action you want performed. You want to open graphs for all locations. Are these graphs being displayed on reports? Do you want one report with several graphs or one report with one graph that plots all the locations? Also can you give some sort of example of what data is being used on these graphs so there is a clearer picture of what is trying to be accomplished.
Jul 9 '07 #2
cloh
41
Thanks for the reply. I tried your code, but I get an error that says that the Method or Data Member is not found (it highlights the GetSaveAsFilename application). Any ideas? I'll try to give you a concise explanation about problem 1 in a bit.
Jul 10 '07 #3
JKing
1,206 Expert 1GB
Could you post the code that you're using?
Jul 10 '07 #4
cloh
41
At the moment I am using this. Basically someone had created a GUI that creates Excel workbooks with graphs in them. By choosing the graph type from a drop down menu, you can change the kind of graphs displayed. He has a "Browse" button with no functionality associated with it, and my boss wants me to modify it so that you can use the button to select where to save as well as name the workbook that eventually results. I hope this make sense. Sorry for being so confusing, and thanks for your help.


Private Sub cmd_Browse_Click() 'edited by CLoh on 7/9/2007

Dim xlApp As Excel.Application
Dim sFname As String
Set xlApp = New Excel.Application
sFname = xlApp.GetSaveAsFilename
Dim SaveFileAs As Variant
Dim Finfo As String
Dim Msg As String
Dim I As Integer
Dim FilterIndex As Integer
Dim Caption As String
Finfo = "All Files (*.*),*.*"
FilterIndex = 5
'Dialog box caption
Caption = "Save Workbook As"
'Get filename
SaveFileAs = Application.GetSaveAsFilename([InitialFileName], _
[FilterIndex], [Caption])
If SaveFileAs = False Then
MsgBox "No file name as provided."
Else
MsgBox "Workbook will be called " & SaveFileAs
End If

End Sub
Jul 10 '07 #5
cloh
41
Alternatively, if I use a code like that shown below to browse to the required directory, is there a way I can make the path show up in a text box so all the user has to do is add the file name?


Private Sub cmd_Browse_Click() 'edited by CLoh on 7/9/2007
Dim Msg As String
Msg = "Please select a location for the backup."
MsgBox GetDirectoryPath(Msg)

End Sub
Jul 10 '07 #6
rewalk
17
I may be wrong, but I believe that in order for your code to work you need to add a reference to the Microsoft Scripting Runtime. To do this go to your VBA editor and then Tools, References, scroll down until you see this choice and click the box next to it. I know that in order to access File System Objects you need this reference added and I suspect that maybe this reference isn't added in. If it is I apologize, but I figured I'd throw this out there and hope it helps.
Jul 10 '07 #7
cloh
41
Hi rewalk,

I just checked and there is no "References" option under Tools... I'm doing all this in Access. I'll keep looking and let you know if I find it.
Jul 10 '07 #8
Not sure if this thread is still active...Also, bear with me as I am new to Access, VBA, and online discussion forums...

While working on my code, I bumbled upon the "References" In the Access 2003 VB window by doing the following:

1. Click on the "Object Browser" icon on the Standard Toolbar (Note: you can also press the 'F2' button on the keyboard)
2. Click the right mouse button to activate a pop-up window.
3. Select "References"

If an administrator is checking this posting...
I have an Access VBA programming problem regarding opening a dialog box for users to import an excel file into an access database. There seem to be a couple of "threads" on the forum. Should I post my question to an existing thread or start a new one?
Jul 12 '07 #9
MMcCarthy
14,534 Expert Mod 8TB
Not sure if this thread is still active...Also, bear with me as I am new to Access, VBA, and online discussion forums...

While working on my code, I bumbled upon the "References" In the Access 2003 VB window by doing the following:

1. Click on the "Object Browser" icon on the Standard Toolbar (Note: you can also press the 'F2' button on the keyboard)
2. Click the right mouse button to activate a pop-up window.
3. Select "References"

If an administrator is checking this posting...
I have an Access VBA programming problem regarding opening a dialog box for users to import an excel file into an access database. There seem to be a couple of "threads" on the forum. Should I post my question to an existing thread or start a new one?
Start a new one. You can refer to other threads by their url if you wish.
Jul 17 '07 #10

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

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
9
by: Tom | last post by:
A question for gui application programmers. . . I 've got some GUI programs, written in Python/wxPython, and I've got a help button and a help menu item. Also, I've got a compiled file made with...
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
5
by: Steve | last post by:
I have written a help file (chm) for a DLL and referenced it using Help.ShowHelp My expectation is that a developer using my DLL would be able to access this help file during his development time...
8
by: Mark | last post by:
I have loaded Visual Studio .net on my home computer and my laptop, but my home computer has an abbreviated help screen not 2% of the help on my laptop. All the settings look the same on both...
10
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably...
1
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve...
0
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.