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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Populating Fields from an Alias Table 1

Status
Not open for further replies.

Cradders

Technical User
Jul 21, 2005
25
FR
Well having solved my previous problem so quickly thanks to you guys, :-D I've got another curly question for you. I'm sure I'm just doing something daft but I can't figure out what's going wrong.

Here's what I want to do:
Automatically populate Billing Address fields with Main Address data by default, with User authorisation to overtype results.

Within Contact database I have an 'Organisation' table. This has contains fields for two types of addresses:

Main Address (with sep fields for street, town, postcode, country etc)
and
Billing Address (matching fields, but with Billing in front of their name)

So I created a relationship based on the field 'CompanyName' through an Alias of the 'Organisation' table, and set the BillingAddress fields to Auto Lookup the corresponding MainAddress fields.

So theoretically it's set to "When a new record is entered in the field 'Company Name', look up main address details and put them in the billing address fields"

It doesn't work.

The annoying thing is it did work, once, and now I can't get it to work again. I don't know wny it did before and doesn't now. I didn't change anything. It doesn't matter if I'm creating a new record or modifying an existing one, those darn fields won't populate.

Help, am losing my marbles.

Cradders
 
Are you using FM 7?

In pre-7 you need to have multiple fields. 1) The field that contains the actual data from the referenced table, such as Customers::CustAddress. 2) The field that you can type a new address into such as Invoice::CustAddress. 3) a calculation field that is:

Case(
Isempty( Invoice::CustAddress, Customers::CustAddress, Invoice::CustAddress )

Place this 3nd field on the invoice form directly under the 3rd one. Make the 3rd one a button that goes to the 3nd one. Then you can click on the 3rd (calculation field) to go to the field where you can type in something different. If you have, then the new data will show.

In FM 7 it's a bit easier:
In the Field Definition for the Address field on the invoice, set the Auto-Enter option to Calculated value. In the calculation window enter a reference to the address field in the customer file. Close the calculation dialog box and UNCHECK the Do Not Replace Existing Values... check box. This way, if you do not type anything in, the field will show the referenced field in the customer file. YOu can even go a little further but adding color if the data has been changed.

Hope this helps,
Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top