Modules & VBA :: Way To Grab Text From The Window That Shows Location Of File
Jun 18, 2015I want to find a way to grab the text from the window that shows the location of the file using vba in Access.
View RepliesI want to find a way to grab the text from the window that shows the location of the file using vba in Access.
View RepliesI find the following CODE online (Print to PDF). Which work perfectly for me, the only issue and/or modification I am looking for "Popup Window to save the file at any location", instead at fixed location.
Option Compare Database
Option Explicit
Function PrintToPDF(SrcFile As String)
On Error GoTo PrintToPDF_Err
'Function can be called from any report with this: "PrintToPDF(Screen.ActiveForm.Name)"
[Code] ....
How do I grab a value from a query and put in into a text box? I need to grab the name that returns.
Private Sub text_badgeRDM_AfterUpdate()
Dim EMP_ID As String
Dim strsql As String
Dim sqlempinfo As New QueryDef
[code]...
I need code for save dialog file ,and select the file from textbox and save it to the selected location.i have only this code and i dont know what else i can do with this because it just opens the save file dialog !
View 1 Replies View Related I am opening an excel file from access and changing the formatting from "dd/mm/yyyy hh:mm" to number with 15 decimal places.Then I am linking the file to the database and subsequently doing a lookup on the date time on the access form against this table.The excel file when formatted from vba in access shows the wrong number
datetime = 03/05/2013 11:26
database number = 41397.4763888889
Excel file number = 41398.4763888889 (which would equal 04/05/13 11:26)
now if I do it manually then I get 41397.4763888889 or if the macro is in excel I still get 41397.4763888889.Also I have tested the code with manually editing the excel file and this works fine.
Code:
Private Sub Command288_Click()
Dim s As String
Dim t As Integer
Dim ws As Worksheet
s = LaunchCD(Me)
MsgBox (s)
[code]....
also this brings up a form and then I select the field required for the lookup and with the button is pressed the rest of the code runs as follows.
Code:
Private Sub LoadData_Click()
Dim w As String
w = Forms![frmList1]![Combo0]
w = "[" & w & "]"
Dim dtA As String
[code]....
I have been searching all over on how to create an import button on a form in access 2010 where I can set which table it should copy the data into but the user could locate the import file.
NOTE: the reason being I have locked all the ribbons...
If necessary I could make a specific import template file which would have all the headings locked...
When creating an incoming inspection database, I want to set it up so when I am in a form to add data, I want to have a command button where I can pull up the associated CAD drawing based on part number and drawing number. I would like to enter the directory location into a table so I could change it if I need to.
So basically I want to go something like this:
.tblDirctoryLocation
txtDirectory
.tblProduct
txtProductName
txtProductNumber
txtProductCADNo
These tables would not be related to one another as there will only be one record for the directory location and multiple records for products.
Somehow I want the db to assemble file location like this:
“EQuality_DirectoryIncoming” & “ProductNumber_” & “CADDrawing” & “.pdf”
End result: EQuality_DirectoryIncomingProductNumber_CADDraw ing.pdf
Is there any way this could be done?
How easy it is to add a button to a form with a function to copy a zipped file to another location and unzip it?
View 10 Replies View Related I have created a database that tracks the locations of all the faxes we receive in a day. We have a dedicated employee that enters them into the database as well as who they are assigned to and other pertinent information. At the end of the day, I monitor the network folders where the faxes are saved to change the status of the fax in the database to done, still needs processing, or awaiting approval. Is there any way that I could set up some VBA that would automatically update the status column for the record based on the location of the file? The file name is recorded in the database so then if it sees that that file is in the end folder it could automatically update the status to finished.
The response I got on another forum is as follows:
-The impression I'm getting is that you've got a database of information over here.
-And it lists the file name, but not location.
-And then you have a physical folder structure with the fax files in it.
-And there are folders for done, awaiting approval, or processing.
-So what you're looking for is something to read those folders and update the status column based on which folder it is in?
-So at the start of the day we have:
New
-Fax1.tiff
-Fax2.tiff
-Fax3.tiff
-Fax4.tiff
Finished
-
In progress
-
And at the end of the day the folders look like this:
New
-Fax1.tiff
Finished
-Fax3.tiff
-Fax4.tiff
In progress
-Fax2.tiff
And you want your code to browse those folders, and update the status of each filename based on it's folder?If the filenames are unique, you can just use VBA to open the folder, create an array of the files and then set the status. Create two separate functions, one for in progress, one for completed and call them one after the other. There'd be no need to check the current status, but you could store the wrong status if a file is duplicated, or a filename repeated.
I want to create a button on my form that when pressed will scan my multi page document (ADF) from my Epson WF-3540 and save it as a specified file name and folder.
View 5 Replies View RelatedI'm currently working on a database to track and inventory documents in my organization similar to a library catalog, but with a digital archive as well. I'll need the ability to "attach" documents to records in the main inventory (though using links instead of storing it in the db) and have the documents live in a centrally accessible location on our shared server.
I will need to have this function work through a few different tables and in a few different iterations, but I'm trying to work on the simplest part first, which is attaching a thumbnail/preview of a given document to the record for that document.
I've got some VBA working well which opens the file picker and copies the file to a directory relative to the DB. It also creates a folder with each employee's ID number if it doesn't exist already (which it gets from the Windows log in) and adds "Copied_" to the front of the file.
Now I'm trying to get the VBA code to interact with the record. Presumably I need to tell the form button I'm using to launch the VBA code to pass the primary key of the record being displayed to VBA. Then, at the end of the VBA code I need to take that value and find the record again from VBA so I can update the MediaThumbnailLink in the original record.
Does this order of operations make sense? If so, how should I go about passing these values back and forth and writing the new link value?
Here's the VBA I'm using so far...
Code:
Option Compare Database
Public Sub GoCopyThumbnail()
Dim fDialog As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim varFile As Variant
Dim LUser As String
[Code] ....
Hello team,
My database window is hidden.
I have a form with data about an article. When I click a button, another form opens showing a sales graph of that article.
On the form with the graph, I have put another button to print it. The code behind that button is:
Private Sub printpriceevolution_Click()
On Error GoTo Err_printpriceevolution_Click
Dim stDocName As String
Dim MyForm As Form
stDocName = "frm_priceevolution"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.Name, False
Exit_printpriceevolution_Click:
Exit Sub
Err_printpriceevolution_Click:
MsgBox Err.Description
Resume Exit_printpriceevolution_Click
End Sub
The funny thing is that after the printing (which works fine) my database window is shown, where it is supposed to be hidden.
Any idea what could trigger this? Does it have to do with pop-up dialog box settings?
Thanks
I would like to have a button on my form that would update a record to a closed status, but I want to have an "Are You Sure?" window pop up first. I did a search on "verify," "verification," "sure," and several others but haven't found what I need. I looked through my Access bible, with no luck.
Any help is GREATLY appreciated. Thanks!
In the access form I want to add a button with a special functionality.
After clicking "Select file" button special window should be open (or something else). It should give user a possibility of files locating (doc, pdf, rtf, txt ...).
After selecting the file and confirm the choice in the table "File_location" in database path to the file should be saved .
I need some simple code that will copy an Excel file or a table in Access to a specific location on an FTP server. I would think this would be a very simple task, but I have yet to find any sample code that is *simple*. I have seen lots of code that requires downloading this dll or that mda, but the examples don't work. There must be something built into MS Access 2010 that will allow a file to be uploaded to an FTP site.
All the variables are known:
The FTP location (it never changes)
The FTP Username and Password (they never change)
The destination folder on the FTP site (it never changes)
The File type (it never changes)
The File name (available from the form in Access from which this will be executed)
I can either produce an output file, then copy it to the FTP site, or I can export the table directly to the FTP site with the file name for that day.
This seems to be a very simple task with no simple solution. Currently I am using an FTP app to get the file to the FTP site, but I would like to automate this. The process that creates the output file is already automated, so I would just like to add this to the existing code as its own module.
I'm looking for a simple command on the idea of:
DoCmd.FTPFile, acExel, TableName, FTPFilePath, FTPFileName, Username, Password, acUpload
just made all that above up and none of it is a real function/command in VBA, but is just the kind of thing I'm looking for.
I would think that since I can download and XML file from an FTP site that it should be child's play to upload a simple file to an FTP site, but I can't figure it out.
hi,
can i set the location of my windowform?
i have created a dummy tabstyle form. It exsist out of 3 forms. Those forms are on top of eachother. is there a way that i can lock the windowlocation. for example: form.left = 0
or someting like that?
thanks
I have two subforms in a main form. book_sub and book order subform. there are various subforms which i toggle in book order subform window by changing their properties with command button on main form. here is the code -
Code:
private sub billq_click()
Me.BOOK_SUB.SourceObject = "BILLQ"
Me.BOOK_SUB.LinkMasterFields = "[BOOK ORDER SUBFORM].FORM![ORDER ID]"
Me.BOOK_SUB.LinkChildFields = "[order ID]"
private sub stock_click()
Me.BOOK_SUB.SourceObject = "stock"
Me.BOOK_SUB.LinkMasterFields = "[BOOK ORDER SUBFORM].FORM![BOOKCD]"
Me.BOOK_SUB.LinkChildFields = "[BOOKCODE]"
Now the problem is when i change billq to stock it shows parameter entry window with caption [order id] twice. after clicking ok it does toggle the form to stock. then when i click button for billq again it shows the same thing.
the code works fine except showing parameter entry window twice with every toggle.
Hello, I was needing some help coming up with the code to search the local hard drive and grab a file and then import it into an Access table. I'm trying to do this on a form if possible. If you know of another way, that would work. Any help would be appreciated. Thanks.
View 9 Replies View RelatedI would like to export a table as a text file to a user defined location.
I have it mostly working, but not exactly as I would like. I'm stuck on the user defined location.
I have a Form that contains a subform and two command buttons.
The subform contains the table I want to export as a text file.
The text file has to be comma delimited, no qualifiers.
I have the transfertext command in VBA that works perfectly:
Code:
DoCmd.TransferText acExportDelim, "My Specification Name", "MyTableToExport", StrDirTemp & "input_" & StrPName & "NameCode" & StrDIAUnFormatted & "d" & ".txt", False
What I'm stuck on is the filepath. The file path changes everytime. So I would like to have either the open dialog box (I've tried many different versions that I found on the web.) or to search by the account name for the folder and place the text file in there.
Here is one that is closely working how I want it to:
This is a function that I found, that opens a dialog box for the user to select the folder location. It works, but I can't seem to get it to work properly.
It prompts, the location, then once you select it and press ok. It will add the folder name to the full file name, and place the file in the default root path. Not the selected folder path.
So in the end it will look like this:
D:1_MainMyFolderName_MyTextFileName.txt
I'm somehow stuck on getting to seperate the file path from the file name, so you it look like this:
D:1_MainMyFolderNameMyTextFileName.txt
Code:
Dim MSg As String
Dim SelectedDir As String
Dim SelectedDirFinal As String
Dim SelectedDirName As String
Dim StrFolder As String
[Code] ....
I think it should be something very easy, that I just need a pair of fresh eyes to look.
I've tried the Fileobject, FileFolder method, but can't get the quite work properly.
I've also tried wildcard methods as well:
StrDirTemp = Dir(StrFolder & StrPName & "*", , vbNormal)
But keep throwing up blanks.
i had a database that allowed me from a form to store a file location for a record on a form, so i any time i could access the record, and then open the file, usually a pdf, it wasnt stored as a hyperlink, but as long text
i made the mistake of not copying the files for safe keeping when i got a permanent position..i am now back self employed, i need to recreate the database.
What I have is two fields, one is a simple date and the other is slightly more complex as it holds a date but in a different structure (a dated case number).
The case numbers are for example, 150211551223 the date being the first 6 numbers and equaling to 11/02/2015. so the code will need to grab this data, spin it around and convert it.
The formula will then be:
simpledate - convertedcasenumberdate = days between.
(simpledate will always be the latest date of the two).
I have some vba where I'm importing a text file and splitting it out into a table. For the most part its working just fine.
But I have a line of data that I need to pull out the string right after "Old" - Murphy and right after "New" ZMurphy
Acc# : 111111 This is test data, Person : 22222 Old Murphy New ZMurphy
I'm thinking Instr() could do this but I'm unable to get it to work.
I am using Access 2010...
I'm trying to figure out at what point an error message occurs while a database is closing. This problem only occurs if someone clicks on the red close button on the top right of the screen when there are several forms open. If the user exists normally there is NO problem.
I am attempting to use the print statement to write to a text file to track what is happening as the database shuts down. Unfortunately, the open (print) statement, when issued, zaps any prior contents which precludes having a full printed record. I am hoping for a print syntax that would allow appending.
Code:
Open "ErrorReport.txt" for Output as #1
Appended text to the file to show what is happening in that event.
Close #1
The program, in closing, does stop with an error message that a certain file can't be found. But when I click on debug, the program simply closes. I have also commented out VBA references to the file that can't be found, but the error still persists .
From a command button what would be the code to copy a file from one location to another i.e copy c:datasalesdata.mdb to e:databackupsalesdata.mdb
Jabez
The access file has a lot of rows which do not show on the excel file. The added files in access either have a space before their names, an * before their names, or no name at all. I would attach the new access file but it does not show up on my windows 7 list of files on my computer. It only shows up as a new file on my access program.
View 3 Replies View RelatedI have recently been working on the code below and I have neally completed what I want to do.
Private Sub H_Enter()
Form!H = "hyperlink#E:WORKSPEC PROJECTWORKSPECS" & Form!S & Form!PC & Form!extension & "#"
End Sub
What I want to do is have the file location (bit I have bolded) stored in another form or table and have the code read it from there as the file locations may change, rather than having to enter it for each line I just want to enter it once and then as and when it changes I just change the one line but it changes all the hyperlinks
hope this makes sense.