I have an odd request. I have made an application that produces an html/printable invoice in a table format.
What I am trying to do is figure out how to take such a table, which may have 3 or as many as 20 rows on it depending on who's using it, and paste it into power point.
It seems to do it, but the result varies.
Any idea on where to start? I'll buy something if I have to!
Select the first field of the HTML table by double-clicking it
Then press Shift+end keys (or Ctrl+Shift+end )
This will select the entire table.
Now you can copy the table and paste it wherever you want to
You can also automate the entire process for multiple tables
Related
I have a table that contains data from repeated experiments (for example, site A has one sample, and the lab processed the sample three times obtaining slightly different values). I need to average these results in a separate table, but what I have read on the Microsoft support site is that a query that pulls data into another table with a calculated field is not possible on Access.
Can I query multiple data points from one table into a single calculated field in another table? Thank you.
UPDATE
I ended up doing a lot of manual adjustments of the file format to create a calculated field in the existing table that averages each sites data, so my problem is, for my current purposes, solved. However I would still like to understand. Following up with you both, I think the problem was that I had repeated non-unique IDs between rows when I probably should have made data columns with unique variable names so that I could query each variable name for an average.
So, instead of putting each site separately on the y axis, I formatted it by putting the sample number for each site on the x-axis:
I was able to at least create a calculated field using this second format in order to create an average value for each site.
Would have there been a way to write a query using the first method? Luckily, my data set was not at all very hefty, so I could handle a reformat manually, but if the case were with thousands of data entries, I couldn't have done that.
Also, here is the link to the site I mentioned originally https://support.office.com/en-ie/article/add-a-calculated-field-to-a-table-14a60733-2580-48c2-b402-6de54fafbde3.
Thanks all.
I posted a couple times over the last couple of days about some trouble I'm having with an inventory database that I'm trying to make at work. I have very little experience, so have been mostly following YouTube tutorials and walk throughs online.
Essentially I have a table that will be filled with inventory information such as ID number, manufacturer, model number, etc. I then have a form that has a text box for each field in the table that the user will fill in and then an Add, Delete and Edit button that will allow them to either Add a new record by filling in the text boxes and clicking Add or select a current record in the table from a combo box or list and edit it or delete it by clicking the associated buttons.
I tried to code this first and kept getting an error for the past two days no matter how much I tried to fix it and what advice I got on here, so now I'm at the point where I'm just using queries to do it.
Right now I have a main table, temp table, the form, and then these queries:
1. delete query that will clear the temp table
2. append query that will take the records from my temp table and add them to my main table
3. append query that will take the selected record on form and add it to the temp table
4. update query that will update the fields on the main table to the data in the temp one
5. delete query that will delete the record you select on the main form from the main table
This was my plan:
for adding a new record
1. run query no.1
2. load the form
3. if OK button clicked:
4. run query no.2
for editing
1. run query no.1
2. run query no.3
2. load the form
3. if OK button clicked:
4. run query no.4
for deleting:
1. load a msgbox with the YesNo options
2. if Yes button clicked:
3. run query no.5
The one I'm having trouble with is query number 3. I've made the query correctly to the best of my knowledge, but when I fill out the form and click add it tells me the query is going to append 0 rows and then it doesn't add anything to the temp table.
I also can't seem to figure out how to take the data from the temp table and move it to the main table using the query.
I'm linking to an IMGUR post with screenshots in it here:
http://imgur.com/a/ffWge
Any ideas?
I hesitate to answer this since there are too many points to cover. Gustav already gave great advise about learning to use Access Forms like they are intended. But from the screenshots, it looks like you misunderstand something fundamental about the Access query designer. Even though you shouldn't have to write any queries for want you want to do, at some point you will need to understand how to properly design a query.
If you want the query to insert FROM the form INTO the table, then the table field references should not be in the criteria, they should be like this:
Field: [Forms]![frmInventory]![ICN]
Table: {leave blank}
Append To: ICN
Criteria: {leave blank}
Also, remove [tblInventoryTemp] from the query window since you already specified the destination table in the Append Query pop-up window. The SQL should look something like this:
INSERT INTO tblInventoryTemp ( ICN, model, serial, ... )
SELECT [Forms]![tblInventory]![ICN], [Forms]![tblInventory]![model], [Forms]![tblInventory]![serial], ...
Likewise for the other query to copy from temp to the main table. You should have already specified the destination table in the pop-up window, so remove [tblInventory] from the query window. Also remove the list of fields you have in the Criteria row. The SQL should look something like this:
INSERT INTO tblInventory ( manu, model, serial, ... )
SELECT tblInventoryTemp.manu, tblInventoryTemp.model, tblInventoryTemp.serial, ...
FROM tblInventoryTemp
Access will likely add more details, but the general form of the SQL should match what I have.
I have a table that I need to update each day. The data comes in a text file every time. I wrote a program that extracts the data from the text file and and writes it in the table, but now I want to modify it to just update the existing data. The data is mostly the same, it might differ only a few things.
I was thinking about MERGE but I don't know very well how I could use this in my program. All the examples that I saw used a second table.
So it would be like creating a second table in which I extract the current data, after which I make the merge into the old table to update the records. I want to avoid creating a second table, so I was wondering if there is any way to do this?
Thanks!
What is the best way to organize a big database.
The way it works is that only I am allowed to touch or modify the database but interns help sometimes to collect data, we used to have the whole system excel based, back than we had the macro which by choosing 2 files it will integrate and mark in colors the changes.
How can I create something friendly to use which will update by pressing a button and also will show changes!! I am familiar with the update query, however:
it doesn’t track any changes.
I want to know other options.
To sum up the way of processing is:
I have the database and I need to split some data to smaller files so other employees will work on.
Then I will collect the files and integrate with the existing database, but since we are all human mistakes can happened that’s why I want to be able to track easily changes.
The updates are going to happen often. When I will give the intern a temp. table The possible changes are for example: address, phone number, price, they will do those researches based on current data which they will find online which information has been changed, and they will change the info which is on the temp. table, That is why I want to be able to know what exactly did they found out. Lets say if Product A (product ID1234) used to cost 10$ and today its 12$ from the same supplier. I just want to know and to see that the price for product ID1234 has been changed. Not only to have it updated to the back end database. For quality assurance I need to track which new input they did in relation to the product ID. (some times input by someone else which was done in wrong format or wrong column could affect big time on the quality of the reports)
So this was the explanation for what I need the reports
So in order to make those temp. tables, I want to create a form for it that by choosing region, category etc. and then clicking on a button it will automatically select the relevant records from the database, create a new table/access-file and then copy the selected records to the temp. table. So someone else could work on it...
Next thing is that it would be nice to know how can I create a template for tables, by template I mean to standardize by validation rules. some fields I'd like to have dropbox menu, some fields ready mask for phone number.... etc.
Final part, after they made the changes and saved the file (the temp. table which they were working on), I want to be able to update the back-end database via clicking on a button...
Looking forward to get the best solution!
Thanks in advance J
Michael
Okay for the temp tables thing:
why not split your database in a backend part (having all the tables) and a frontend part which contain the forms and tables the interns need? I'm guessing mostly it is going to be the same so you can even create multiple different frontend's to give to different interns incase they need other tables. There are a lot of articles out there about splitting a database and linking tables.
Then the thing about the record changes not sure is this is what your looking for but it could help, i haven't used it myself so not sure what it exacly does. But this may help you a bit.
http://support.microsoft.com/kb/197592
I would consider taking a look at the BeforeUpdate event for the form. You can trap the old and new values of textboxes if the form is bound to a table. You could loop through all the controls on your form and check for Me.Control <> Me.Control.OldValue. If they don't match, write both values to an auditing table so you can go back and check whenever you want to. I would include the following fields in your auditing table:
ChangeDate
TableName
ControlName
OldValue
NewValue
Then you can query that table any time you want to see what has changed.
I work with a product that comes in a 2000lb sack and placed on a pallet. When this product is made it has many different elements that are tested and each test has a field that the numerical data is placed in. Each of these records of tests are then assign a number, for example, L20444.
Now we have the ability to take that 2000lb sack and convert it into 80 20lb bags. Only 40 20lb bags can fit on one pallet, taking now the one pallet L20444 and making two pallets that have the number L20444. This causes a problem with inventory because the number L20444 can only be assign one warehouse location, not two.
So my bosses what to create a number that is almost the same, but different enough to place the second pallet in the warehouse. The second pallet will now be L20444B. It will still have all the same tested numbers and is a "copy" of the original L20444.
My question is can I take the record L20444 and copy all the data for that record and then save it as L20444B so that it can be placed in the warehouse.
So is it possible for VBA to copy a record, rename it, and then save it in the same database as a new record?
Any help would be appreciated, Thanks.
If I'm reading you right it sounds like you want a SQL statement to create a new record.
You're using Microsoft Access? I would recommend first creating a query that does this in the query editor. It will be an Append query, something along the lines of:
INSERT INTO TableA ( ID,col1, col2 )
SELECT [ID] & "B" AS NewName,col1, col2
FROM TableA
WHERE (([ID]="L20444"));
Test this first to make sure it's doing what you want, and make "L20444" into a parameter ([OldID], or something). Then add some code in your VBA script that executes this query. It should pop up asking you for OldID when you run it.
Then you'll need to learn how to execute parameterized queries from VBA.
Something like this:
Set qdf1 = CurrentDb.QueryDefs("myQuery")
qdf1.Parameters("OldID") = theOldID
qdf1.Execute
Not tested, search VBA help for QueryDefs if my syntax isn't quite right.
Why don't you create a new table, which tracks the location of the two pallets (and the new number(s)), which links back (with a foreign key) to the single record for the stock in the original table?
That should work, and will avoid what will otherwise become a nightmare of redundant data.