Modules & VBA :: Button On Form - Making A New Windows Folder

Aug 22, 2013

I currently have a button on a form which, when clicked, I would like to do several things:

1) Check if the folder, "folder name (1)" exists
2) If no, make it; if yes, check if the folder, "folder name (2)" exists
3) If no, make it; if yes, check if the folder, "folder name (3)" exists
4) repeat this process until a new folder is made

The code I currently have seems to not work, and makes an infinite loop

Code:
Private Sub Export_Click()
Dim checker As Integer
Dim projPath As String
checker = 1

[Code] ....

View Replies


ADVERTISEMENT

Open Windows Folder From Access ??

Jan 3, 2007

Please forgive my Newbieness and accept I am a keen ametuer running a small business and trying to use access as a tool. No doubt I will be back with many questions as you all seem so knowledgeable, thanks in advance.
Can't really do code but get on OK with built in wizards etc. Wonder if someone might be able to help with this one:

Is it possible to set a command into a form that opens up a windows folder elsewhere on the computer or network? For example, receive email from DIY multiple containing kitchen plan, installation costing etc, as attachments. File attachments in folder on server, manually enter detail into access database which generates "Customer ID Number", decides which fitter, surveyor etc. then need to email a report (have managed conversion to PDF and to launch outlook) but then wanted to copy and attach the original attachments to this new email, along with Access report for forwarding to various surveyors / fitters around the UK. Thus require if poss to open file on server, copy attachments and paste in new e mail, thought it would save time to do by one button press to open server file??

May seem easier to just forward original e mail but unfortunately some of the info in the mails from the DIY multiples is not for distribution and filtering isn't possible.

Perhaps one simply can't do it but worth asking, thanks again. Paul

View 3 Replies View Related

General :: Open A Specific Windows Folder

Aug 14, 2013

Open a specific Windows Folder.I am using this code to open a specific Windows folder ..... and it works perfect:

As String Dim folder
folder = "c: Documents WORD"
Dim Retval
Retval = Shell ("explorer.exe / e, / root," "" & folder & "" "", 1)

... but also need to open in the specified path, taking the data "UserName" of one field in a table:

TABLE: "Assignments" IDEExp, UserName, Date

So instead of going to the folder = "c:Documents WORD" would go to: c: Documents WORDUserName ". In Windows and subfolders are created with UserName1, 2,3,4, etc.

View 10 Replies View Related

Modules & VBA :: Return Folder Directory To Text Box On Forms Record When Click Browse Command Button

Nov 12, 2014

I need to return a folders directory to a text box on my forms record called Files_Directory when i click the Browse command button... The folder will have more folders within it along with documents all relivant to the folder selected, hense the need for just the folder directory rather than a file.

View 12 Replies View Related

Modules & VBA :: Open Folder Nested Inside Main Folder?

Mar 16, 2015

I'm trying to open a folder based on a BIN nr. This folder could be in a main folder that has diferent subfolder. As there where differnt naming used to create the folderes, one of the things they have always is the BIN nr. It alwasy start with a unique number and maybe I could use it to scan the subfolders and open that one that the BIN nr is equal as in the field BIN.

Now we have serveral 1000th of folders and finding them takes time.

View 3 Replies View Related

Making Command Button Flash/Preview Form

Feb 2, 2007

I. The two issues I am trying to address is to see if there is simple code that can be used to make a command button flash.

II. I need to show in a small pop-up box users that have expired licences. When the main License form is first called to open, I would like a smaller pop up box or preview form to open up(without operators except for the close button). The pop-up box will be based on a query that already exists to show those with expired license. Can the form be similar to the pop-up calendar found in Access already?

Thank you:o :)

View 2 Replies View Related

Modules & VBA :: Hyperlink To Folder In A Form

Sep 26, 2013

I put in contracts in a form in Access.

Each contract has a Special ID. it's called mietvertragsnummerID (German Word).

Now i want by pressing a button, that for the choosen ID, a pdf, which gets saved in a seperate Folder, gets opened.

So i have the ID 18. (in the form in Access)

In the Folder M:FBGrimmSuW was saved the contract with the Name:

Mietvertrag18.

I've created the following code, but it doesn't work.

Code:
Private Sub Befehl4065_Click()
Dim sPath As String
sPath = "M:FBGrimmSuW" & "Mietvertrag" & Me.MietvertragsnummerID & ".pdf"
End Sub

View 2 Replies View Related

Modules & VBA :: Using Images In A Folder On Report / Form

Feb 28, 2014

I have photos stored in a folder on a drive. I have referenced them before in a simple picture viewer I created in a form. I create the file name by referencing the values of a list box on the field.

Example:

The list box has piid.2005.001 and image name is 2

filename = C:Temp" & pidd & "" & piid & "_" & imageName & ".jpg"
C:Temppiid.2005.001piid.2005.001_2.jpg

Each piid has it's own set of photos in their own folder

Now. I want to be able to print out all the files in a report/form. The piid and image name are stored in a table called tblPhotos so I could reference there.

I want to have a button I click that generates a report/form that spits out all the photos in that folder. Next to a button would be a text box (txtWhichPiid) where you enter in the piid and that's how you know which piid's photos to use.

View 2 Replies View Related

General :: Making A Form Button That Will Act As TAB- Move From Field To Field In The Form?

Jun 12, 2013

I made a form for use in touch screen app. I would like to make a form button that will act as TAB- move from field to field in the form.

View 4 Replies View Related

Button To Open Windows Explorer Window

Jan 28, 2006

Hello everybody, it's been a while since i wrote on the forums and yet again I am in the need to ask for the help of this wonderful community.
I have a form on which is a button that I want when pressed to open a Windows Explorer window displaying the contents of a directory.
The exact way that I want this thing to work is like this : The user is browsing a form of lets say client details and on the form lies the button that when pressed will take the client's name and apply it to the path in order to open that Windows Explorer window and create a path like C:program filesclient name and display the contents of that window.
I would like if possible someone who can point me as to how I can construct this button to work cause I cant see to get it done.
Many thanks for your time :)

View 3 Replies View Related

Launch Windows Explorer Window From A Button (directory)

Apr 7, 2006

I would like to be able to have a button that my firm's legal assistants can click which will automatically popup the folder on the server where the client's documents are stored. What is the easiest way to write this?

View 3 Replies View Related

Making A Button To Import .csv Files

Feb 8, 2006

Hello, i want to make a button on my form to input .csv files. What is the best way to do this? I simply want to click the button and be asked for the csv location, i want the csv to be imported and be formatted. Whats the best way to do this?

View 2 Replies View Related

Making The Command Button Visible Sometimes

Aug 14, 2006

Hi
I would like to make a command button appear on a form only when certain criteria is put in a control on the form.

For example, one of the controls has a drop down menu. When the user picks "Washed" from this menu I would like a comman button to appear.

The control is called status and the command button is called searchali.

so far I have tried this:in the after update of the control.

If([status] = "Washed", [searchali].visible = True, [searchali].visible = False)

or
If([status] = "Washed" then me.[searchali].visible = true else me.[searchali].visible = false)

an other variations of this and I can't get it to work. I've set the command button to visible = no to start with and the bound column of my control to 0 since I want the first column criteria.

If anyone can see where I might be going wrong, or if there is another way of doing this I would be sooooo grateful!
thanks,
Sie

View 6 Replies View Related

Making Last Record Appear In Macro Button

Apr 14, 2014

I have created a button with Macro located on form in record. It does what I want except I want it to display only last record. Currently it is displays first record and I have to scroll. See attached photo of what I have. Access 2010

View 2 Replies View Related

Forms :: Unable To Create Command Button To Open Folder On Desktop

Feb 19, 2015

I am simply trying to create a command button to open a folder on my desktop

Cannot seem to find this code

This is the path to the folder I want to open

C:UsersJONATHANDesktopCMS FILES

View 4 Replies View Related

Making A Command Button Of A Delete Query?

Feb 16, 2006

Hi!

I'm having problems making a command button(Ta bort från engelska till svenska) of a delete query.
The name of the query is"Ta bort från engelska till svenska", which is also the name of the button on the form(huvudformulär)

Could someone please help me.
I'll enclose my zipped database.

Nille

View 2 Replies View Related

Forms :: Making Object To Appear On Button Click

Jul 3, 2014

What vba code would I use in the on click event of a command button to make another button appear?

View 10 Replies View Related

Works On Windows 2000 Not Windows 2003

Sep 19, 2006

I have a website that is asp (not .net) based with an Access DB and I am in the process of replacing an old windows 2000 server with a much faster windows 2003 server. Here lies the problem I have a script as part of the admin that exports data to a csv file. The query joins 4 tables together to get the data needed for the export. On the windows 2000 server it takes 1-5 seconds to execute and have the csv file ready for download. On the window 2003 server it times out. I striped it down to use 2 joins and it worked although it took more like 10-20 seconds to export. This exports a specific range of ID's and the range is normally only 40-50 rows. If I put time stamps in the code the problem is in the query of the database, so I know its not in the file write etc.

I am going to rewrite it to use multible querys instead of one large query, but I have many other sites that I am moving to this server that would work better if I can figure out why it is so slow.

The windows 2000 is a 900 mhz server the windows 2003 is a 2.8GHZ server both have 1 GIG of ram. The database file is on the local drive on both servers. I am guessing it is a difference in the Jet version, I just haven't been able to find a solution to the problem. This uses a DSN connection, configured the same on both servers. I have also tried it as a DSN-less connection with the same result.

I have installed access on the server and to execute the command in access it is <2 sec.

I am not an access expert I normally program in .net and php and use MySQL and MsSQL for databases, we just have these legacy sites that use Access DB's

View 1 Replies View Related

How To Open A Dialog Box To Move Files Inside A Folder That Is Setup As Current Folder

Sep 2, 2015

I'm trying to automate a process of selecting a set of file/s and move them in a folder. When I click on a button, it should open a current folder that is setup in the code.

Lets say that I have a folder C:documents est, and very time I click on the button, it should open the dialog box with that path so I can select the files from another folder, drag them there and they will be saved in that folder.

This will form part of wider automation that will send an email stating that those file/s where placed in that folder.

I have in the same form where the button is placed, 3 check boxes that needs to be passed to the email as well that one or all the files where placed in the folder.

View 10 Replies View Related

Modules & VBA :: How To Force Windows Task Bar To Always Be On Top

Apr 14, 2014

I write Access 2010 apps in VBA that require no knowledge of Microsoft Access on the part of the user. My forms contain all the necessary controls to use the program without relying on any of the Microsoft Access toolbars. I call this "de-Microsofting" the app. When I prepare the .accdb program to create a .accde app, I uncheck every checkbox (Options/Current Database) except "Compact on Close". This works well, but it also hides the Windows taskbar at the bottom of the screen. Some of my users need to be able to jump from my app to others (e.g., Excel) and back without having to exit my app. How can I force the Windows taxkbar to always be on top using VBA or, possibly, some setting?

View 4 Replies View Related

Modules & VBA :: Force Windows Sync To Run

May 7, 2015

I have an application that is using SQL Express as a backend and syncing to a SQL database through SQL web synchronization. This all works great and my clients have my custom application to interface with their local database and do work and it syncs back to the corporate database and I've got it scheduled to run in Windows every minute. What I would like to do is have a button or on event set of code that forces that sync pairing to run and I'm not exactly sure how to do that.

View 3 Replies View Related

Modules & VBA :: Retrieving User Name Logged Into Windows?

Sep 20, 2013

Continuing with production of my database I've come across another wall that I'm trying to pass. My aim is when the user press the "Quit" button it will export everything to a file which is stored on Google Drive as google drive is installed on the laptops that will be using this database.

However the problem is Google drive is stored in the computer user files i.e C:UsersstudentGoogle Drive - is there a way to retrieve the name of the user that is logged into windows?

Code:

Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _
(ByVal IpBuffer As String, nSize As Long) As Long
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" _
(ByVal lpBuffer As String, nSize As Long) As Long
Function ThisUserName() As String
Dim LngBufLen As Long
Dim strUser As String

[code]....

However cant get this to work - I think that is probably because i'm declaring this code in the wrong place - I've tried declaring the private functions in a class module and the functions in a module - however no success - How do you set this code up? Or is there a new way to do this?

View 14 Replies View Related

Modules & VBA :: Scheduled Task On Windows Server

Apr 20, 2015

I have a vbs-script that opens my access database db.mdb and runs the module "Export":

dim accessApp
set accessApp = createObject("Access.Application")
accessApp.OpenCurrentDataBase("D:Datadb.mdb")
accessApp.Run "Export"

accessApp.Quit
set accessApp = nothing

This works fine as a scheduled task on a Windows 7 computer.

Is there a way to make this work on a Windows Server 2008 R2 ? When I double click the vbs-file, the file opens instead of runs. And when I create a scheduled task, nothings happens.

View 2 Replies View Related

Modules & VBA :: Call To Display Windows Theme

Jul 14, 2014

On the Windows 7 Developer desktop, the Windows Theme is set to Windows 7.On the Citrix server (for users) the Windows Theme appears to be Windows 95. It is low graphics.The boxes are square instead of rounded. The selected Form Tabs just barely highlight with a thin line while on Windows 7, the selected Tab completely changes color. A basic Message box in Windows 95 looks square and flat. The title bar is very low graphics as one would expect when graphics were not great. Is there a VBA call that can display the OS Theme that affects MS Access? URL...

View 2 Replies View Related

Modules & VBA :: Up One Folder In FilePath

Jan 24, 2014

FilePath = CurrentProject.path

I am currently using this path, but I moved my database folder into another folder so people won't mess with it. I still need to create files to the original directory. How can I make the FilePath still relative but up one folder from CurrentProject.path?

View 5 Replies View Related

Modules & VBA :: GetElementByID With Internet Explorer Using Shell Windows

Jul 16, 2013

I can currently open a new internet explorer instance, navigate to my URL, then use the .getElementByID to insert my preference into a textbox on the page. Looks like this:

Code:
Dim oIE As Object
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Navigate "URL of my Choice"
Do While oIE.Busy Or oIE.ReadyState <> READYSTATE_COMPLETE
DoEvents

[Code] ....

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved