Creating report based on input form in MS Access - excel

I am currently developing a database to monitor my employees' work. Yet, MS Access is new to me and I encounter a fundamental problem when creating reports.
I wish the system can generate reports based on the values of an input form. Say, I would like to check Peter's work in January, I could simply enter:
Name: Peter
Month: January
Then the Access would be able to generate a corresponding report. But I am not sure how it works. And I am thinking of three possible approaches.
(1) Input form -> Query -> Report
I look up youtube and learn how to build an Access form that passes a parameter value to a query. And then I can click the Create Report button.
(2) Input form -> Report
Not sure it works or not. But I learned a bit VBA which may be helpful in this case.
(3) Export to Excel
Export to Excel might be a good option. I can use various functions and filters to select the information I want.
Sorry that my question is being abstract. Any help is appreciated.

there are many ways you could achieve this.
One way (it may be the most efficient or not depending on your query / data you need to output in the report).
Build the query.
Build a report with its record source based on the query.
Build a form with input controls and a button.
With the button you are going to open the report. In the open statement of the report you are going to specify the controls as filters to some of the fields retrieved by the query.
Example:
Private Sub POrdine_Click()
On Error GoTo Err_POrdine_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "EmployeeWork"
stLinkCriteria="EmployeeCode=" & Forms![frmNameOfForm]![cboEmployeeCode] & " AND WorkMonth=" & Forms![frmNameOfForm]![cboWorkMonth]
DoCmd.OpenReport stDocName, , , stLinkCriteria
Exit_POrdine_Click:
Exit Sub
Am assuming the two comboboxes are going to pass a numerical value, the employee code (which would be a primary key) and the value of the month. Build the queries that feed these controls so that you may see the employee name and the month name. If in doubt just ask.
Notice how this approach may not work well for reports based on large amounts of data.

Related

How to create a search function within Excel

Could somebody please help me create a search feature in Excel, intended as a contact lookup? I'm reasonably comfortable in Excel up to 2016 but have no VBA knowledge so I hope this can be done without it. Using Excel 365 and it will be published to Sharepoint to specific users. I know it's poor practice on here to rely on sample data so I'll do my best to explain with a couple of screenshots.
Situation:
I have a raw data sheet containing 50,000 rows (CustomerName, ID, City, Country, EmailAddress etc). Our sales team need to look up contact details but only if they know the customer's name, or part thereof.
I need to hide the underlying data but a rudimentary system is acceptable, we just don't want to serve it up on a platter. The basic shove-it-under-the-mattress method by making it all white text; lock all cells; hide all rows and columns; password protect and hide the sheet is fine for now - no one will be determined enough to start picking that apart.
I've searched here and while there are similar results, nothing really fits perfectly. The most suitable so far was on extendoffice which doesn't quite suffice (will put link in attachment). It utilises SEARCH, RANK, ROW and VLOOKUP functions, the interaction of which I don't entirely understand, but it works.
Interim steps for the lookup function on sheet "Search"
Issues with current concept:
There's no discernable order to the results. The RANK and ROW functions seem to randomly assign ranks, and when you get 50+ results with no way of sorting it will be frustrating.
Whenever one person queries it undoes the last person's search. Expected, but not nice
Partial string search with results unsorted
Additionally:
This doc will be on Sharepoint, directly accessible by ~20 people. Ideally, when one person searches it won't change on someone else's screen
Results should appear alphabetically by customer name
Nice to haves:
Add another criteria to search by. Eg City or Account Manager - doesn't have to stack
Select and copy the contents of a cell (eg email address), but not allow editing of the value or formula. If not possible I'll leave the cells completely locked as the trade-off of accidentally overriding a formula is not worth it.
Any help would be super appreciated

Data import from new reports and automatically update existing records in existing data

I seek expert advice of all of you in accomplishing my work related task.
Task : Task it to perform Analysis on reports obtained to WorkSafe Monthly and weekly and getting valuable information out.
For example :
Number of injuries on monthly basis drilled down by department and divisions.
Total days lost in year
Count of type of claims
Possible return date.
So i receive these reports and i add some modified columns to it. Like Correct employee names and their ID's just to create a relationship between Employee database in Powerpivot so that i could get their position, dept and division.
Now every month in new report there could be 2 or 3 new claims added to it, and some existing claims with updates info. like Updated return to work date, Short term disability days etc.
Currently i go through them manually and it's really time consuming and tiring. if there there was older claims weren't getting updates i could've just imported from a folder using power query and added steps to remove duplicates. However, if i remove duplicate claims using powerquery now, basically i'll be removing same claims with updated info.
Could anyone you here suggest an efficient way to do it with power query or with other approach?
Thanks in Advance. I'd appreciate your time and effort.
If you use PowerQuery and select your source From File -> From Folder, when you choose to combine and edit you will get a table with its first column named Source.Name; which you could use to differentiate the updates.
For instance: If I start with two excel files in the same folder (theoretically, they could be different date source files for you)...
WS1.xlsx:
WS1 - Copy.xlsx:
Then I use the folder they are both in as the source...
(Navigate to your folder as appropriate.)
...and select Combine & Edit...
...and select the worksheet...
Then I get this:
...and it is clear what information came from what source file.

Using Microsoft Access Database to put values in an Excel Template

I am trying to build a better structure for creating product specifications for our products, Currently everything is done in excel, as a result every time a value is changed, it takes numerous man hours to make that change to all the specifications. Additionally, our inventory of products continues to grow. I am trying to introduce a new system for developing specifications that will allow me to manage the snowball effect of growing specs and increasing work for simple changes to the entire product line.
My question is, if I build a database with all the necessary values for the template we already use (an excel sheet), is there a way I can enter a part number in the excel template and have all the other values populate into the template at their appropriate locations?
I have posted images of the template and a sample of what the Access database could look like.
Thank you for your help.

Export data from lotus notes database

I am using a lotus notes database, where our whole company adds its customer data to it. The search function should give me the customer and when I click it I get more detailed information, which I need for my daily work.
However, I have to search this database and it is quite unreliable in terms of displaying the data and also often because of data insertion errors I do not find what I am desiring.
Therefore, I was wondering if I could export this database to excel and search it through with the filters.
Any recommendations how to do that?
I appreciate your replies!
You could also utilize the native full-text search of Domino : in the [View] menu, click "Search this view".
Select all the rows you want to export.
Do Edit/Copy AS>Table (could be long)
Past in EXCEL you will also get a link to the document in Excel.
This solution is relevant only if you research in few data. You may also build a "clever" view in Notes (exploding spaces for example) and search "start with" which is alway up to date.
I have pulled Notes view information into Excel from the Excel side via VBA - you'd need (to create) a view with all the relevant fields in columns first. Here's some code that worked for me: Accessing Lotus Notes database from Excel VBA - how do I pick up COLUMNVALUES?
I was picking up category subtotals..presumably you want the document contents instead so change the
Set Entry = nav.getNextCategory(Entry)
to
Set Entry = nav.getNextDocument(Entry)
and tweak the VBA code to suit which columns you want... good luck !

fetch data from ms-access to ms-word

i am looking to create an invoice in either MS-excel or MS-word. This invoice will contain several fields like invoice no., customer name, product info, quantity, Amount, Date, Address of customer, phone no. etc. The function of the invoice will be, to generate a unique invoice number, every time i open it, and then the vendor will mention the customer's info, product's info and click on submit button or save it. The info mentioned in the invoice will automatically be saved in the MS-Access database whenever submit button is clicked or the document is saved.
Thus, All the records of the customer will be saved in the MS-Access database. whenever i need to search for a particular customer, i should be able to search it from either invoice no. or any unique field for that particular invoice. I hope my query is explained clearly. please let me know the easiest way to do it. I do not have the vast knowledge about this subject, so give me suggestions that are understandable by a Novice.
I think you are starting from the wrong end. Use an Access form to get the data and then run a mailmerge, the easiest way is to output a text file from Access as the data file and use a Word template for the merge.
An autonumber may suit for invoice number as long as all you need is a unique number. If you need documented sequential numbers, you will have to create then yourself. How you do it will depend on the number of users working at the same time.
I can tell you now, generating Word files with Access is a bit of a pain in the ass. If you really want to do formatting it gets hard (is my experience).
I ended up generating HTML files in which I could control everything, and opening them as .docs. But if you are really new to this, I suggest you start with some VBA tutorials, where they explain to you how you get records from you database and loop through them to generate output. And then you can start looking at file writing functions in VBA.
Can't find any tutorials real quick (my girlfriend is getting angry as we speak), but here is a sample:
http://www.access-programmers.co.uk/forums/showthread.php?t=25354
Just look around in fora, look for file generation and looping through records.
Hi just reading your post, like Remou l would strongly suggest you use Access to enter and store the data. It is possible to get a user to enter data into a spreadsheet and write the data back to Access DB. Not something l would recommend for the novice, here is a link to some code on how it could be done
Returning to your first question, of creating the invoice have you considered generating the invoices from Access using a report? They can be printed to PDF, or exported to various electronic formats. Or is there specific reason to use Word/Excel? If are going down the route of using Word to generate the invoice then use a template as Remou suggested. See this link for some samples see the section titled Access > Word. I have used the examples as a basis for Access to Word. A number of the examples though use a tecnology called DAO, which l understand will not be included in any operating system after Windows 7. Just something to be aware of.
Searching for a record in a database table this link has one possible solution . Also the author has included a example database.

Resources