Problem Re-initializing

R

richaluft

Problem Re-initializing order/entry form/Subform

I have an order/entry type form/subform, which is not re-initializing
properly. The form consists of a
form header, into which a patient name is inserted in control 'Select
Pt'. After a patient is selected,
the After_update procedure attached to this control calls
"EnableControls ("Detail",False,Me).
{See below for code}.


Each invoice has an Entry(invoice)#, derived from a Get_Next_Counter
module, which is obtained in the
form_on current procedure.
Some additional data is then entered in the form header, including a
control [Select Insurer], whose
On_Exit event includes:
Me!Subform.Enabled = True
Me!Subform.SetFocus
There is also a control on the detail section, [Patient ID#], whose
value is set by command:
DoCmd.Apply Filter,"[Patient ID#] = Me![Select Pt]


A popup form then opens for addition of further information (for
which controlSource is a table
unrelated to the form or subform), and focus is then directed to the
subform, in the Detail section.

The RecordSource for the form is table "Patients", while the
recordsource of the subform is SQL
"SELECT Services.* FROM SERVICES WHERE (((Services.[Patient
ID#])=0));"
{Note that I'm using this format so that previously administered
services do not show up in the subform,
as they do if I use the table "Services" as the recordsource.
Services is linked many to one to tbl
"Patients"}

If I simply close the form after adding data for one patient, it works
just fine, however, if I try to use
a command button "Next Entry" and try to re-initialize the form, my
[Patient ID#] contol is fixed with the
previous ID#, and the data in my subform is not clearing out, as ---
Subform.[Form1]![Patient ID#] =
Form![Form1]![Patient ID#].
I've tried setting this value to null without success.

The code attached to the 'Next Entry" btn are as follows:
DoCmd. RunMacro, "ClearForm"--- which sets values in form header
controls =Null
Then the subform is requeried with command "Forms![Form1]!
[Fsubform].Requery"
This last command seems to be where the problem is, in that when
I then debug the patient
value in the subform, I find that it is still equal to the value that
was previously entered, as above mentioned.

Any suggestions to enable me to reset ther value of my ID# field would
be greatly appreciated. I hope that
I haven't made my explanation of the problem too garbled to be
understood.
Richard
 
R

richaluft

Problem Re-initializing order/entry form/Subform

I have an order/entry type form/subform, which is not re-initializing
properly. The form consists of a
form header, into which a patient name is inserted in control 'Select
Pt'. After a patient is selected,
the After_update procedure attached to this control calls
"EnableControls ("Detail",False,Me).
{See below for code}.

Each invoice has an Entry(invoice)#, derived from a Get_Next_Counter
module, which is obtained in the
form_on current procedure.
Some additional data is then entered in the form header, including a
control [Select Insurer], whose
On_Exit event includes:
Me!Subform.Enabled = True
Me!Subform.SetFocus
There is also a control on the detail section, [Patient ID#], whose
value is set by command:
DoCmd.Apply Filter,"[Patient ID#] = Me![Select Pt]

A popup form then opens for addition of further information (for
which controlSource is a table
unrelated to the form or subform), and focus is then directed to the
subform, in the Detail section.

The RecordSource for the form is table "Patients", while the
recordsource of the subform is SQL
"SELECT Services.* FROM SERVICES WHERE (((Services.[Patient
ID#])=0));"
{Note that I'm using this format so that previously administered
services do not show up in the subform,
as they do if I use the table "Services" as the recordsource.
Services is linked many to one to tbl
"Patients"}

If I simply close the form after adding data for one patient, it works
just fine, however, if I try to use
a command button "Next Entry" and try to re-initialize the form, my
[Patient ID#] contol is fixed with the
previous ID#, and the data in my subform is not clearing out, as ---
Subform.[Form1]![Patient ID#] =
Form![Form1]![Patient ID#].
I've tried setting this value to null without success.

The code attached to the 'Next Entry" btn are as follows:
DoCmd. RunMacro, "ClearForm"--- which sets values in form header
controls =Null
Then the subform is requeried with command "Forms![Form1]!
[Fsubform].Requery"
This last command seems to be where the problem is, in that when
I then debug the patient
value in the subform, I find that it is still equal to the value that
was previously entered, as above mentioned.

Any suggestions to enable me to reset ther value of my ID# field would
be greatly appreciated. I hope that
I haven't made my explanation of the problem too garbled to be
understood.
Richard
Forget about this post.
Problem solved with "DoCmd.Showallrecors!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top