pass mainform.field to subform.field

P

patti

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
 
P

pietlinden

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).
 
P

patti

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
 

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