Universal Path For Exporting Table?
Aug 5, 2014
I've created a macro that will export one of my tables to a .csv. Everything is all fine and dandy, except that I need to find a way to have this command work on any computer. As of now, the command exports to C:UsersKodyDocuments, and can only do so because this path exists on my computer. But if I were to send this Access file to someone else to use, they would get an error stating that the specified path is not valid. Is it possible to create a general export directory which would work with any computer this is ran on?
View Replies
ADVERTISEMENT
May 27, 2014
I have the code below and I want it to open a file from my documents folder. The only problem is that every computers path is different to this folder. Any easy way to work around and open a file in My Documents without the full path?
I want to eliminate the part of the path in red and make it universal because computers will have a different number.
Operating System: Windows 7
Code below:
Public Function AddITARPicOffloadAnalysis()
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application")
With xlApp
Dim wb As Object
Dim ws As Object
Dim Lastrow As Long
[Code] .....
View 9 Replies
View Related
Jan 27, 2015
I have an option group where the user reads a question and either has to select yes or no. There are multiple questions on this form. If the user selects 'No' I'd like a "why" form to pop up and allow the user to write a reasoning down and have it saved in a record in a table (the same table that the yes or no answer is saved in).
Right now I have it working, but my method will force me to make a specific why form for each question (which will be over 50). This doesn't seem very efficient.
View 13 Replies
View Related
May 26, 2014
Till now I managed to publish and save all in C:Reports. What I'm trying to do is Save to path specified in Path. DB attached.
Private Sub PrintAll_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim MyPath As String
Dim MyFileName As String
[Code] ....
View 6 Replies
View Related
Nov 14, 2005
I need to ascertain the current link path for my back end DB tables.
Using Application.CurrentDB.Name returns the current MDB file - but I need the DB file for the linked tables? Any ideas please?
THanks in advance.
Guido :rolleyes:
View 3 Replies
View Related
Aug 3, 2015
I have a table that contains passive and active devices. I want to find correct active device to which passive device is connected. However passive device can be connected to another passive device and after that to an active device - could be endless times a passive device is connected to passive device and then in the end to an active device. So the code needs to plot the path from beginning passive device to the correct active device.
I will include excel table with data and wanted result.
The criteria for passive devices that need its active device found, is i think something like this:
Code:
SELECT * FROM tablename WHERE [TYPE] = "D3P" AND NOT [Mark] LIKE "*ZUUM*" AND [Sort] = "Passive"
I got the result via doing excel function index-match for like 5 times and excel stalling. However I would like it to be done automatically.
View 1 Replies
View Related
Jan 8, 2014
I have a table named tbl_imagepaths with fields:
ImageID
File
Folder
The command button has the code below, it works great and pops up with a window with the file name and path. I now just need the code to insert the file name and path into the table....
Code:
Private Sub Toggle7_Click()
Dim f As Object
Dim strFile As String
Dim strFolder As String
Dim varItem As Variant
Set f = Application.FileDialog(3)
[Code] .....
View 7 Replies
View Related
Aug 20, 2014
I am trying to automate the function that imports Infopath (.xml) data into access tables. I can have a button run the MenuCommand, but then the users have to go through all of the prompts and I just don't trust them enough to do it properly.
All I want is the user to click a button, then it lets them browse for the desired file and then imports it.
View 1 Replies
View Related
Nov 18, 2014
I have a form where I can add a new resident. It runs off a query that shows ID as null and has a button to add the data and refresh the form and query. I used to drop in OLE files but have since changed it to a linked image file. What I want to do is pull the info from the data that I input as a new resident.
Basically it means that any staff member can take a photo of the resident and put it in a folder and the database will point to that file.
The location is..."C:UsersRP"&[First Name]&" "&[Last Name]&".jpeg" First Name and Last Name are in the table already. I have tried using an append and an update query to no avail.
View 2 Replies
View Related
Nov 22, 2005
Hello everyone,
I frequnetly need to export tables for others to use. I export them as .csv files usually and I'd like a way to include what I call metadata in the .csv file.
ideally, it would appear on the top of the file before the comma-delimited data actually starts.
I can't figure out how to include the table field descriptions in a file.
any help?
thanks,
giffordpinchot
View 10 Replies
View Related
Sep 30, 2005
How do you get to see the entire file path in Access Linked Table Manager of linked tables that are located in a folder with a long path? The problem is that you can only view the first 64 or so characters of the table’s path. This is a real problem when these linked tables need to be updated and you don't know where it’s stored.
Jean-Guy
View 3 Replies
View Related
Sep 21, 2007
Hi all.
I ave a table in access that has a column in the format single with auto setting for decimal places (I'm guessing this is 15 sig figs but I'm not too sure). What I'm trying to do is export this file as a csv so I can use it SAS. When I use the export function and select csv it truncates the data so all i get is 2 decimal places.
I can't export as a excel then rename as the file 1.4 million records long and so is too big for excel to handel. (I did try it anyway and it only exported the first 65000 rows).
I'm not an expert at all in Access, and would have little idea how to write any code that would allow me to do this.
Can anyone please help me as I urgently need to do this.
Thanks a lot.
Menes
View 2 Replies
View Related
Nov 15, 2006
Hi all, I use a d'base that exports a table via a query to Excel. Once the user hits the button to run this command it can take between 30 sec to 60 sec until the data is displayed in excel.
Does anyone know of anyway to speed this process up. Currently there are around 12,000 records with the table.
DoCmd.OutputTo acOutputQuery, "qryArchiveReport", acFormatXLS, "Archive.xls", True
thanks for looking:)
View 1 Replies
View Related
Feb 22, 2008
Hello guys,
I am working on a database that requires a user (with very little access knowledge) to export a table into .dbf (DBase IV Format) using a button and VBA.
I realize this can be done by right clicking on a table and click export. However I did not give the end user access to the tables (being a good DB Developer!) and also I don't believe I can teach this particular user how to do the steps to accomplish this.
The scenario: Third party software needs (SwissSys, which is a chess software) to grab information about players and ratings from a .dbf file (and will not work with access). I have developed a database for the association so that they can edit players information, and update the ratings directly off the website (www.chess.ca) and it automatically updates in the database.
The idea is, the Access Database updates the ratings from the website, and then the user exports that data into the dbf file (players table) that is directly linked to the third party software.
I am looking for a way to use VBA code to either 1. Create/Overwrite the existing dbf file when exporting the tblPlayers, or 2. Append/Update the current dbf file with the updated ratings, and creating new entries when necessary when exporting the tblPlayers.
Unfortunately I have had little success in finding code to export to a dbf file, anyone have any ideas?
View 3 Replies
View Related
Aug 24, 2004
Hi there i am exporting a table that has linked tables to others (ie the "+" you get when you link the tables) but when i export the table ... the linked tables dont get exported.... can someone be kind enough to help with this
View 6 Replies
View Related
May 2, 2006
I need to export a specific record in the table. The menu's export option only export the entire table. Is there a way to define certain record to export?
Thanks
View 1 Replies
View Related
Oct 10, 2005
I am going to attempt to explain the problem:
I design a form and all my work is based on that form.
I have two tables which I join together as following.
The unfitex field is calculating using fields from both tables as shown below.
Dim db As Database
Dim rst As DAO.Recordset
Dim sqlstr As String
v = Combo37.Value
sqlstr = "SELECT postdecgor.N1, postdecgor.Age, postdecgor.UNFITpc, postdecgor.DECENTpc, postdecgor.HHSRSpc, [UNFITpc]*[sample]/100 AS UNFITex, postdecgor.DECENTex, postdecgor.HHSRSex, [Sample size].[Age dwelling], [Sample size].sample FROM postdecgor LEFT JOIN [Sample size] ON postdecgor.Age=[Sample size].[Age dwelling]WHERE ((postdecgor.N1)='" & v & "'); "
Set rst = db.OpenRecordset(sqlstr, dbOpenDynaset)
Set Form.Recordset = rst
I then set up some textbox which shows the results as following.
N1.ControlSource = "N1"
Age.ControlSource = "age"
UNFITpc.ControlSource = "unfitpc"
DECENTpc.ControlSource = "decentpc"
HHSRSpc.ControlSource = "HHSRSpc"
UNFITex.ControlSource = "numunfit"
UNFITex.ControlSource = "unfitex"
DECENTex.ControlSource = "decentex"
HHSRSex.ControlSource = "HHSRSex"
It works, I can see the results on the screen, however I would like to save the results into a table and I am not quite sure how to go about it.
Can you help??
Thanks for your help
View 1 Replies
View Related
Mar 19, 2008
Hi guys. I'm a bit of a noob with Access. I have a table which is 15 rows by 250,000 columns. So there are about 3.75m records.
What I need to do is to get access to export a number of csv files automatically from this table.
I need each csv file to contain all the data in the table for a certain range of rows. This is determined by a value in a particular column. This is a sample of the table.
http://i30.tinypic.com/aljf5s.jpg
Basically Store_Nbr represents a UID for a particular store. All the data is currently in one big table, and I need a single csv file for each different store_nbr (so it contains all the data in the table for each unique store). Also, for each store_nbr, there are different Year Month of Surveys. For each store_nbr, I need a different csv file for each Year Month of Survey. This will probably divide up the 250,000 long table into about 200 csv files, as there are about 50 different Store_nbrs, and there are 4 surveys for each individual store.
Sorry if I've not made myself perfectly clear.
I'm sure there's a simple way of doing it, but I really do suck with access and was wondering if you guys had any idea.
Many many thanks!!!
Cheers
View 4 Replies
View Related
Sep 21, 2006
Hi,
I export a query as csv to upload to another database on a web site. When that csv file has been exported I'd like the query to be emptied, so that the next time I export I don't export duplicates. What's the easiest way to do that?
I've been thinking of having a field in the table with a check box that is checked when the file is exported. The query then selects only those records where that box is not checked.
But how can I check those boxes on Export rather than when I run the query? The reason being that I may want to preview by running the query, without having that affecting the check box.
View 1 Replies
View Related
Feb 12, 2008
I have an Access table say Tbl_People that looks like :
ID1-ID2-Name-Age-Location
xxx-yyy-Mike-25-Essex
uuu-vvv-Jack-32-Surrey
mmm-nnn-Bob-36-Newcastle
I want to transfer this data into another table say Tbl_Output with four columns in the format below:
xxx-yyy-Name-Mike
xxx-yyy-Age-25
xxx-yyy-Location-Essex
uuu-vvv-Name-Jack
uuu-vvv-Age-32
uuu-vvv-Location-Surrey
mmm-nnn-Name-Bob
mmm-nnn-Age-36
mmm-nnn-Location-Newcastle
In Tbl_Output's 3rd column, only the Columns names: Name, Age and Location are repeated for each person and not column names ID1,ID2 (only its data xxx,yyy etc. is required in columns 1 and 2 as shown).
I was helped by rpeare with a VBA module that gives a single column output in Tbl_Output as
Mike
25
Essex
Jack
32
Surrey
Bob
36
Newcastle
The code is:
Sub main()
Dim db As Database
Dim rstElements As Recordset
Dim sName As String
Dim sNumber As String
Dim sArea As String
Dim freefile
Dim Filenumber As Integer
Dim sSQL As String
Set db = CurrentDb
Set rstElements = db.OpenRecordset("tbl_elements")
rstElements.MoveFirst
sSQL = "DELETE * FROM Tbl_Output"
db.Execute sSQL
Do While rstElements.EOF <> True
sName = rstElements.Fields(1)
sNumber = rstElements.Fields(2)
sArea = rstElements.Fields(3)
sSQL = "INSERT INTO Tbl_Output (OutputField) SELECT '" & sName & "'"
db.Execute sSQL
sSQL = "INSERT INTO Tbl_Output (OutputField) SELECT '" & sNumber & "'"
db.Execute sSQL
sSQL = "INSERT INTO Tbl_Output (OutputField) Select '" & sArea & "'"
db.Execute sSQL
rstElements.MoveNext
Loop
Set rstElements = Nothing
Set db = Nothing
End Sub
How can this be modified to get the required format data above? Thanks for any help in advance
View 4 Replies
View Related
Aug 2, 2012
Using DoCmd.TransferSpreadsheet I'm exporting a table which has a couple of Yes/No fields formatted as Yes/No. However when I export, they appear as TRUE/FALSE? Am I doing something wrong?
View 3 Replies
View Related
Jan 4, 2014
I am trying to export text to a 2010 word document from an access 2010 database with DAO. I have successfully been able to export text from the main table tblLandSales via variables (below) and then subsequently a document. I used the following code:
Dim objWord As Word.Application
Dim docm As Word.Document
Dim rst As New ADODB.Recordset
Dim strSQL As String
Dim strLandSalesID As String
[Code] ....
Now I want to export other data from a one to many related table where [fk_tblLandSalesID] is the foreign key in the related table and tblLandSalesID is the primary key in the main table.
View 5 Replies
View Related
Oct 13, 2014
I need to export/print every single record from table as a pdf file (one record one pdf file). how to do this.
I'm working on Access 2000.
View 1 Replies
View Related
May 1, 2015
When exporting a table from Access as a text file, it keeps adding .00 to the end of the number format records that I am tying to export.
Why it is doing that and what I need to do to prevent that from happening?
View 3 Replies
View Related
Mar 14, 2013
When exporting my tables from access to excel my table names change if they have a space in the name. Example table name "New Record" turns into "New_Record".
What I am trying to do is export the table data to excel than update my access program than imort the table data back. This way I can take a vertion of my access program and update/modify it as time permits than reinsert all current data with min down time.
The code I am using is as follows:
Dim td As DAO.TableDef, db As DAO.Database
Dim out_file As String
out_file = CurrentProject.Path & "excel_out"
Set db = CurrentDb()
For Each td In db.TableDefs
[Code] .....
View 14 Replies
View Related
Sep 6, 2012
I want to export a table in access table .
1. for example every day at 8.00 it create an output excel file.
2. Attach the file and send to a fixed email at that time.
View 1 Replies
View Related