Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filling page with even numbered records

Status
Not open for further replies.

foxrainer

Programmer
Jan 10, 2002
270
US
Hi all,

I am writing a little program for nurses which allow patient medications to be printed on a sheet of paper. The report, will allow 3 medications per page, each with a grid of 31 days by 4 time periods:
------------------------------
Medication |am | | |
info |noon | | |
fields |pm | | |
here |night| | | etc, etc

Here is the problem: If the patient is only on one or medications, there will be a blank space (also, obviously, if the patient is on 4 or 5, or 7 ot 8 medications etc)

What I need is to fill the page with 3 grids, regardless.

I thought the only way to do that would be to make a query which will add blank medication records if the number is not devisable by 3, but can't come up with a good scheme.

Any advice?
 
How about something like this.
After gathering up the meds, check the RECCOUNT() and append until there are enough:
Code:
SELECT * FROM test3 INTO CURSOR rptmeds READWRITE
SELECT rptmeds 
DO WHILE (RECCOUNT('rptmeds') % 3) # 0
   APPEND BLANK
ENDDO
BROWSE

You could always use a temp table if you have a version of VFP that doesn't support the READWRITE clause for a cursor.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top