date related query design in MS-Access - ms-access

I have a table which stores prescription records of patients.
To print the prescription I designed a report based on a prescription-date query where parameter is given as Date() in criteria column to print prescription of a patient given on the today's date. In spite of correct query design as shown in help of MS-Access, the records are not seen except "Todays Date".
Fields in table are Prescription no-indexed, PNO-patient no-indexed, prescription date- which is Todays date-Date(), drug name, quantity and dosage.
I need to enter drugs and print them immediately to hand over to patients.
I dont know why its not working
Please suggest a solution. I dont have knowledge of syntax, I use built in libraries in MS-Access and have programmed forms, querys, tables and reports and macros to run the patient database.
email ID - san_sgprasadi#dataone.in
Dr Prasadi

Related

I'm trying to create a multi-table Query on MS Access. Both tables contain dates but at different frequency

I'm trying to create a Multi-Table Query on Access to improve operational efficiency.
I have two Tables:
EPOS (where: Date/Item Code/Sales for the day are contained on a daily basis)
MATERIAL (where: Date/Item Code/Opening Stock for the day are contained on a weekly basis)
I have Daily data for EPOS (Sales), but only Weekly data for MATERIAL (Opening Stock).
I'm trying to Run a Query that allows me to filter by item code in the Design View, and display daily data for EPOS and just weekly data for Opening Stock.
I'm trying to have it displayed at this frequency, with Opening Stock being shown just for where data is available.
When I've tried, my data would only be displayed on a Weekly Frequency (basically, only where Opening Stock information is available).
See here
I tried my best to make my request as clear and concise as possible, any questions, please ask.
Thanks in advance for your help.

MS Access: How to search a value on a table by clicking on a form record

I'm pretty new to Access and coding in general and I've been working on a database that was filled with data extracted from SAP.
I have a query that works as a way to "summarize" the information of a bunch of records from some purchase orders, it does sum the total of each PO, it's date as well as other information. It does consolidate a variety of items related to the purchase order into a single record that is displayed in a continuous subform for easy analysis in this structure.
[MES_CORTE][SOLPED][PO][FirstMIGO][TOTALPOVALUE]
This way, the user can preview easily each purchase order, date, value and other relevant information. This query is also used to generate some reports.
However, I want to be able of opening the source table ([Registro_OC]) and search the related records by clicking a field on the subform for a detailed view and posibly to edit or enter new data. is it posible?
I've tried to code some macros but can't figure out how to reference the table fields related to the query fields that are on the form.
Also, it seems that Access doesn't allow to create subforms based on continous forms.
Any help and opinions are appreciated.

How do I store data pertaining to a month or year in Mysql

I receive csv files at the end of each month from my customer for each of their KPI (for example csv's for resumes received, candidates joined, candidates resigned, sales, profits, loss , etc) for that specific month.
I want to be able to query this data inorder to generate reports for any month, day or year. This report will be generated dynamically i.e the admin would specify what rows he would like to have in a report (for eg a report with applications received, applications shortlisted, candidates shortlisted after the 1st interview for the period of jan to july.) for any period of time.
What would be the best way to store the data into my database in order to generate such reports? I am using Mysql as my database.
I am not sure if I would need to flush out the old data from my tables currently. So considering that I keep all the data persistent, what would be the best suited database design for this?
Currently what I do is I have a table for each of their KPI. This table has got a date field which I am using to generate the report. But I am looking for a more optimized way.
Thanks in advance.
It is better to store those values (month or year related values ) in a "Date" type fields which would not need any other manipulation while building reports. The conditions or logic for the specific period of time should be handled in your front end. In this case, the usage of Date field is the optimized way.

MS Access - Multiple Distinct Report Parameters

This is my first contribution for stack exchange. I take to feed-back and criticism well so please make sure I can learn from it if I'm not following correct protocol, community etiquette, etc
I work for a health care company that sometimes performs biometric screenings. I am tasked with creating a simple back-up system for our current cloud-based application. The system has to accomplish the following:
Enter participant into a member table using an entry form
Pull-up the member and record biometric data using a biometric entry form (12 metrics in total)
Allow user to print a report with member demographics, along with biometric detail in this order:
Column 1: Screening Measure (Height, Weight, waist, etc)
Column 2: Current Biometric Results
Column 3: Prior Biometrics (this will come from a data feed and will prepopulate a biometrics table (linked to participation table on participant id. There may be multiple periods for one individual)
In 99% of all situations, a participant will have 1 set of readings for 1 year period (1 for 2016, 1 for 2017, etc). Ideally, I would like to have a year parameter for column 2 and additionally for column 3. When the year is selected from the parameter the biometric values recorded in that year will populate the corresponding column.
My question is, would someone be able to help point me towards resources that help me understand how to tie data to specific parameters in a MS Access Report. Anything is extremely helpful!
FWIW, my short term solution is to build multiple queries to the effect of:
Query 1: Select * from Biometrics where year ='2017' > Most Current
Query 2: Select * from Biometrics where year = '2016' > historical
Bring both sets of results into print form. This will work for now, but I really want to have the ability to select which data based on the parameter in the report.
Thanks!

Access 2010 update date field based on another field

I'm relatively new to Access and VBA but I have managed to get some basic VBA tricks working in both Access and Excel. Now I've got a challenge that I can't seem to crack. I'm building a database to track maintenance of a small trucking fleet. I've got most of the tables and forms I need to do the basic tracking and management of equipment and maintenance in place.
One of the things we're tracking is called PM's which stands for preventative maintenance (lube jobs and oil changes). We do those on calendar intervals for trailers and mileage intervals for tractors. Right now, I'm trying to get the calendar tracked equipment working. I've a table called tblEquipmentMaster which is where all the specifics for each piece of equipment is kept (make, model, year, VIN, etc) and that table has a field called LastPMDate. All the maintenance records go in two other tables, tblMaintenance which records the unit number, vendor, invoice date and invoice amount and tblMaintenanceDetails which records the each line item of work that was performed on the unit (i.e. replaced water pump, replaced headlight etc).
The maintenance details table also contains a drop down list of standard maintenance codes to allow for easier searching of certain maintenance items later. One of those codes is PM. I also have several forms built to interact with these tables including a data entry form for adding new maintenance records.
What I'm trying to accomplish is to have the LastPMDate field for any unit number in tblEquipmentMaster automatically update to match the InvoiceDate field in tblMaintenance anytime an invoice is entered for that unit number which has a line item containing the code PM.
I've tried building an update query to do this but in addition to changing the LastPMDate field like I want it to, it also ends up changing the invoice dates for all previous PM invoices to the date of the last invoice which contained a PM. Not good.
So my question is, would an update query be the best way to do this or would I be better off with some sort of VBA solution? I have an add record button on my maintenance invoice data entry form which users use as a save record/clear form button when all the info for an invoice has been entered. I'm thinking some VBA code tied to the on_click of that button which would look at the invoice you just added, determine if it contains the PM maintenance code, then update LastPMDate field for that unit number with invoice date from that invoice would be a good way to do it but I honestly have no idea what functions or methods I'd need to get that to work.
Any insights or suggestions appreciated.
It's very hard to follow the flow of what you are describing, even if I have experience of PM and AM (Autonomous maintenance).
What is lacking is the relations between the three tables.
Nevertheless I prefer VBA solutions (maybe because I started programming when everything had to be written...). With VBA you can finely control your workflow.
If I understood well the 1st table is tblMaintenance in which you have the Invoice data.
Then you should have to scan the tblMaintenanceDetails to find the list of PMs and filter the tblEquipmentMaster with current PM value to update the LastPMDate with the date of the 1st table.
Did I succeed in providing you an idea to solve your problem?
Let me know.