pass mainform.field to subform.field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main form and subform based on 2 tables

PatientInfo Table
PatientID (pk)
PatientRelation
PatientAddress1
PatientAddress2
etc

BillingInfo Table (linked thru PatientID)
BillingID (pk)
BillingAddress1
BillingAddress2
etc.

I want the mainform fields to populate the subform fields:

if the PatientInfo.PatientRelation = "self" i want
BillingInfo.Address1 = PatientInfo.PatientAddress1
BillingInfo.Address2 = PatientInfo.PatientAddress2

if the PatientInfo.PatientRelation <>= "self" i want the user
to be able to fill in the fields.

thanks for any help.

patti
 
why copy the data at all? If you're basing a report on this, then just
base it on a query instead. If the PatientRelation=Self
IIF([PatientRelation]="Self",[PatientAddress1],[BillingAddress1])
all you would need to do is include the PatientInfo and BillingInfo
tables in your query and left join them (show all Patients).
 
thank you for the help. It does give me a different slant for my work but
these are user forms.

if the patient is not the billed party, the user must fill in this info. i
think it would be easier and less confusing for the user if he knew that info
had to always be filled in.

also, this info will be used for separate mailings eventually and it will be
easier for the user to set up reports.

patti
 
Back
Top