Subject |
Re: beginappend() Problem |
From |
Mervyn Bick <invalid@invalid.invalid> |
Date |
Wed, 28 Jun 2023 11:10:06 +0200 |
Newsgroups |
dbase.getting-started |
On 2023/06/27 17:48, Peter wrote:
> I am having a problem with beginappend() which is called if user needs to enter data for sending bill to someone other than the patient. If there a prior listing for this information, all works fine: existing data is used for datalink of billtotest.wfm.
> However, if there is no prior listing, i.e. no rowset for patient ID, form.rowset.beginappend() does not present user with a blank form. (Based on OLH, I used beginAppend() Example to carry over to the billtotest.wfm. This does not work.)
>
> Of interest is that msgbox for rowset.state is 1 (browse), not 2 (edit) in the first circumstance where prior rowset is found by findkey().
> If there is no rowset found for existing data, a msgbox for rowset.state does not show 3 (append), but shows 1.
>
> So your help would be greatly appreciated. I hope there is only a small error.
> Peter
Trying to solve problems without being able run the code is hard work
and is, usually, purely guesswork. If you post the delinquent form
together with some test data you have a much better chance of being helped.
I appreciate that there are confidentiality issues but as long as the
structure of your main tables match the structure of test tables there
should be no problems. Obviously test tables on your computer need
distinctive names but there is no problem if I change patient_test.dbf
to patient.dbf on my computer. That way anyone with the test table can
run your code.
It also helps if one can see the "big picture". I pointed out in a
previous message that there appear to be issues with your table design.
As you are accessing the newsgroups via Web-News you may have missed
this. If you activate an NNTP connection to the newsgroups at
news.dbase.com you will make life much easier for yourself as messages
will be delivered in the same way as email. Not all email clients
support NNTP e.g Windows Live Mail does, the newer Windows Mail doesn't.
If your email client doesn't support NNTP I suggest you have a look at
Thunderbird. If you do use Thunderbird you do need to remember that you
use the "Followup" button (NOT the "Reply") button to respond to
messages in newsgroups.
The first instruction in the programming section of the original dBASE
II manual back in the 1980's was "Switch off your computer.". The idea
behind this then, and it's still valid today, is that the more time
spent planning a program, the less time spent getting it to run. The
first task is to design the database. Having to change a table's
structure after code has been written can cause major rewrites.
In your patient table you have a logical field BILL_TO. A better idea
may be to change the field type to match the pat_no field. If the
patient will be billed place his/her pat_no there. If someone else will
be billed, place their pat_no in the BILL_TO field. If the person
paying the bill is not a patient a possible solution is to add
NOT_PATIENT as a logical field to the patient table. This would enable
you to exclude the record when displaying patients but include it when
creating a bill.
Before we dig too deep into code let's have a look at how you have
designed you tables. I imagine that, as a minimum you have patient,
appointments, billing, procedures with costs for private and insurance
patients if they differ, outside charges (if applicable) and
service_provider (if more than one) tables. In as much as costs change
over time the procedures table should also include a valid-from date.
Even if you run a single-person practice at present if there is even the
remotest possibility that this will ever change the time to set up the
database to cater for this is now.
Mervyn.
|
|