Modules & VBA :: Import Info Path Data Into A Table?
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.
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.
I have a fill-in pdf form, with fields that match database table fields. My database is in SQL, but I use Access for the forms and reports.
The users will go on-site (and be offline), fill out the pdf forms a bunch of times and come back with a folder of them.
I am looking for a way to have a form where a user can choose a folder (maybe on an access form) and say "import PDFs" and then have all the data in the PDF forms import to the table. A lot of other stuff has to happen in that process (checking the project number on the form, assigning an ID tag for that item, etc).
I have two different database files. One is 2010 ".accdb" format where I have created a form and the inputs to the form is getting saved as records to an access.mdb file in a shared path.Now if the users want to edit the existing record I should allow them to search their previously submitted record with a unique ID number.
I know it is possible when we have both the form and table in the same db. But I want to know whether it is possible to search with a unique ID and pull the data from different db in a shared path using a command button?
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.
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)
I am creating a database where I want to be able to browse to a file, select it and import it into a table. I am able to do this. BUt what I want to do is create a log of these imports and haveit include the path of where the file was inported from.
The field I am having issues with is the capturing the path of the file.
Below is what I am using to browse and import a file.
Private Sub Command5_Click() Dim dlg As FileDialog Set dlg = Application.FileDialog(msoFileDialogFilePicker) With dlg .Title = "Select the Excel file to import"
hi, i've been trying to find a solution to this problem but i can't seem to get my head around it. i have searched through the forums but found all the threads to be confusing although it probably is simple.
im a doing a project for a2 for a trailer tent company
got 2 tables where the problem lies in order stock
they only sell one trailer tent to a customer when a trailer tent is sold, i want to update no in stock in stock table i.e. trailer tent sold --> "no in stock"field for that particular trailer tent goes down by one. I would like the user to be able to change stock level any time as well so don't want it to be fully automated
sorry if i'm not making it clear, not really sure how to explain it
I a trying to list all fields from ALL tables in a certain DB.I am using the tableinfo function. However, because the output of the immediate window is limited to 200 lines, I can only see the last 200 fields. Is there a way to export this in another way than the debug.print procedure, so I can bypass this limitation?
Code:
Public Sub showtablefields() Dim db As Database Dim tdl As TableDef
Trying to create a simple data entry form to get information and populate fields from another table. i.e. type in info in one field and the other fields are displayed in the form with information from another table.
I would like to create a report that would really impress my supervisors, i just started at the company. I'm trying to create a call action plan, so i'm recording clients information on one table, and meetings we have had with each respective client on another table. Some clients will have multiple meetings, some few, and some none. I have a relationship set between them from the client's id number on the client table to the ClientID on the meetings table. one to many.
When I go to create the report, only the clients with meetings show up on the report, I would like client info to always show up on the report and meeting info to only show up under each respective client when it exists. I have worked out how to shrink and hide any text box without any info on it. It just seems like the existence of a meeting dictates where the client will show up at all in the report.
I have a database that I import data from an excel spreadsheet into multiple times daily. The table that this data is imported into has several key fields that if the data already exisits in the table, and I attempt to import data that is the same except for one or more of the key fields is different. At this time the database it creates a different record. I am trying to get the database to overwrite the data in the database.
I am using the follow code to import data from a Word form into my MS Access 2010 DB:
Code: Set dbs = CurrentDb Set rst = dbs.OpenRecordset("tmpSIRs", dbOpenDynaset) With rst .AddNew
[code]...
On the Word Form, these two fields are drop-downs with three options: blank, No, and Yes. If the users leaves them blank, then Access ignores them--which is what I want. However, if the user says yes or no, Access puts a "-1" in the database. Both the Word form and Access field are text.
Looking for (semi) generic piece of code that knows how to handle (semi) random XML files and structures, preferably creating tables and columns on the fly...
Or some code that will read an XML tree and genericaly will add the data to the tables it can find?
I get XML's from a site and want to import the data to Access. If I use the native import then I get multiple tables and the data is a little jumbled. For instance: I get 1 table with track names and a different table for track numbers with no way to relate the to accurately. I would like to be able to parse out the XML and have it update my table as it goes so I have less "junk" in my DB. I just can't figure out how to call out the XML tag and tell it to copy that info to the correct field.
I have a requirement to create a piece of vba that will open all xlsx files in a folder one at a time then import the data in a range (sheet1!A1:G14) into a table named Weekly Input.
I have a text file that details every single incident that happened in the system. This means that it is extremely messy and non-comprehensible to a normal person due to the use of codewords and all.
Is it possible to scan through the document and insert the data into access, such that the different keywords are put as seperate events?
Ps, the number of characters between each event and data may not always be the same, so seperating them by that is not the way to do it. However, when I open the file in notepad++, I can confirm that each event is 6 lines.
E.g. Line 1 = Event timestamp, Line 2 = Event Name, Line 3 = Acknowledged or not, Line 4 = Acknowledged by who, Line 5 = Event Details, Line 6 = Application Owner.
Basically, the 6 lines are the 6 columns that I would need in my table. So, is it possible to separate out and read every 6 lines of data in the text file?
I've been working on a procedure to step through the recordset and add the data one record at a time so I can get rid of the duplicates.
I've tried a few approaches, but this is where I'm at now.
Code:
Dim rs As DAO.Recordset Dim rsHH As DAO.Recordset Dim rsPhone As DAO.Recordset Dim rsEmail As DAO.Recordset Dim rsAddress As DAO.Recordset Dim rsPerson As DAO.Recordset Dim db As DAO.Database Set db = CurrentDb
I'm trying to design a command button on a Form so the user can import the contents of an Excel spreadsheet to an existing Table in Access with the click of a button. But, i'd like the imported data to overwrite the existing data in the Table and not append to it. I've considered using linked tables but apparently you can't set Primary Keys when you do it this way.
I want to import data from one DB to another, but only data without affecting the table structure and names. In the import dialog box has only two options, import tables and data import tables only. I want the third one ;) import data only. Is there any automatic way or do I have to make a VB sub?
What I'm doing now is to importing tables and data to the second DB, but as u know this results in having every table twice like Students Students1 Classes Classes1 and so on. Then I'm removing one by one all the old tables and then renaming every the Table1 to Table. As you can imagine this is not a practical solution and it can be implemented only to small DBs, with a small number of tables. In my case we are talking about a huge DB with over 20 tables, and the above process (importing data) has to be done at least once per month.
Let me inform you that copying data and only data from one base to another is the only method suits in my case so please avoid suggesting alternative solutions.
I currently have a macro that imports data from a spreadsheet and then a query that adds the data into the main table.
But when I want to import new data it deletes the old data out of the table and inserts new data. How can I adjust the query so that it "updates" the new data into the table instead of deleting and then adding?
Another problem is empty records, is there a way of importing data where field 1 has data?
Hi guys, Iīm a unexperienced user of access and itīs my first post in this forum. Hope to make myself clear.
I have several tables. My problem is rather simple but I didnīt find out to solve it. I searched on the forum but didnīt find it. I might not have the appropriate vocabulary yet to perform an efficient search.
My problem is that I have a form to fill a sales table (Salg). For each entry I need to fill the postnumber and the location. On another table (Poststed) is registered the Postnumber and the location name. On the form I did a combobox to get the post numbers. Then to get the location, In another box, which should come automatically after the "Postnr" has been selected, it should display the "location name". I did a "DLOOKUP" for that:
and it works fine. The name come automatically. However, when I validate the "post" then all the data in the boxes are register in the destination table, but not the "location nam". It seems it is not bound to the table because the DLOOKUP function is in the source field. Does anybody knows how I can bound it to the table. Or if I should use another way to do the task, Iīm open to any suggetions. I hope I made myself clear enough.