formula works in excel, can't get it to work in access

killerleaf

Board Regular
Joined
Mar 6, 2003
Messages
113
relatively new to access. I have approximately 64 fields. I want to know how many of them do not have information in them. I go into my query, and right click in the field name, hit build....then in the big box I put Countblank-4 (there are four consistent fields that I don't care about) then, when i go to run, it wants a parameter. I don't understand what to put in for its parameter...I want to know out of all 64 fields, which ones do not have data in them....

or am i missing something? i have tried it in excel, worked like a champ... but i can't seem to get this to work in access.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Well as far as I know there is no Countblank function in Access, so it thinks that 'Countblank' is a parameter.

To check if a field is blank use 'Is Null' as the criteria.

That should return all the records where the field is blank.

BTW 64 fields seems quite a lot. What does each field hold? Maybe the no of fields can be reduced in some way without losing any of the data.
 
Upvote 0
Thank you!! I did not realize that did not exist in access...so...I appreciate it!

unfortunately, 64 is the smallest I can go. It really needs to be more; but had to compromise at 64.
 
Upvote 0
unfortunately, 64 is the smallest I can go. It really needs to be more; but had to compromise at 64.

What type of data is it?
 
Upvote 0
when a patient is on the service, there is a worksheet that is filled out, and pain scores are given. The average is 45 recordings per patient. Some have been as high as 128 entries--but the powers that be recognize the fact that happens only once a year....so we compromised on 60. the other 4 fields are for identifiers for the patient and case.
 
Upvote 0
ok, I tried it, but I must be doing something wrong, as it did not put any numbers in my field... :oops: :oops:

I do apologize, I probably am missing something simple. Like I said, I am pretty new to this...
 
Upvote 0
actuallly, I figured it out..I changed my query to a make table, then export the table to excel, do my formulas, and just print the report from excel. clumsy, but it worked!!
 
Upvote 0
Why not restructure you're data as follows?

4 fields for patient and case identifier
1 field to identify pain score recording - could be date/time or just a number
1 field for actual pain score
 
Upvote 0
I am not sure I follow.....or maybe I did not explain well enough...(which is probably the truth!)

each patient has multiple pain scores. each time the nurse checks on them, they are asked how much pain they are in, scale of 1 to 10. Their answers are recorded on the sheet. some patients may have 5 responses, some have had as many as 150. (depends how long they are on the service) When they are entered, the clerk just pulls up the record by their id number, and then just enters the individual scores, tabbing between the entries.

the report that i am trying to end up with has to show how many observations there were, the highest pain score, the lowest pain score, average of scores, and how many days they were on the service--for each patient. For each quarter.

does it make a little more sense now?

if someone has something that will work more elegantly, please let me know!!
 
Upvote 0
This is a classic problem coming from spreadsheets to databases. Think of your spreadsheet columns as fields, the records as rows. Spreadsheets are very flexible when it comes to adding more fields -- just type in the next column and you're away. Databases prefer to make you rethink your data structure. Fewer fields (because they need to be specifically created) holding more records -- you don't have a 65536 row limit like Excel.

In the example you gave, to average the pain readings, you need to build expressions that take the average across one row, in 64 different fields. Need another field? Wnat to fit them all on a report? Good luck. Instead, in Access you separate the different bits of information so that, for each patient visit, you have a date, the name of the patient, nurse and/or clinician, the pain score, and fields for however many other different pieces of information you need to gather (blood pressure, weight, ...) The advantage: fewer fields, with NO LIMIT on the number of readings you can make for each patient.

An example:
The Patient table needs a unique ID for each patient (use Autonumber) as well as First Name, Last Name, Gender, Date of Birth, the various address and contact details.
The Clinician table needs a unique ID for each doctor (Autonumber), as well as the doctor's name, address and contact details.
The Visits table has a Visits ID (Autonumber), a Patient ID (Number), a Clinician ID (Number), Visit Date, and fields for all of the relevant details of the visit.
To build the relationships between the tables, go to the Relationships view (on the main toolbar). Put all 3 tables on the surface, then click and drage to connect Patient ID on Patients to Patient ID in Visits. In the dialog, click that you want to enforce referential integrity. Do the same to connect Clinician ID in the Clinicians table to Clinician ID in Visits. Enforce referential integrity.
Close and save.

Now, for data entry, you need a form. Click the Forms tab, and New. Select the Forms wizard. Choose Patients as the table to use as the data source. This allows you to browse records by patient. Select all of the fields from Patients, and all of the fields from Visits. As you go through the screens you'll be prompted about how the data will be sorted, grouped and displayed. Don't worry about sorting or grouping. Make sure that you select to view records by Patient, with Visits as a subform.
Choose a name for the form, click OK and sit back. You'll end up with a (fairly ugly, but usable) form showing your patient details. Below, there will be a blank subform where you can put the visit information. Each new visit, add a line to the subform.

It seems a pain at first, but reporting and data maintenance become very simple if you do it right. There isn't tiem or space here to do the topic justive, but do a web search on data normalization. There are plenty of useful tutorials out there. Also, if you will be designing databases, DO SOME COURSES. At least Intro and Intermediate. Advanced too, if you want to build anything useful. And get a good book. Helen Feddema wrote Access 2002 Inside Out, which is pretty thorough. Available from this site is Grover Park George on Access -- also a goodie.

Denis
 
Upvote 0

Forum statistics

Threads
1,221,792
Messages
6,161,997
Members
451,735
Latest member
Deasejm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top