Jump to content

Auto Enter ID and Work Address in Invoices


This topic is 6669 days old. Please don't post here. Open a new topic instead.

Recommended Posts


I am fairly new to relationships but would like some help. I have a contacts file which has up to three different addresses for some of my clients (Home, work and friend), all this data is in one table, I have another Table for invoices. I would like the contactID no. (unique serial) to be automatically inserted (along with the clients name and main address etc) when I click a button for 'New Invoice'. At the moment I have to insert the number in the related field (contact ID) to bring up the contacts details in the relevant fields.

I also need to be able to change the address that the invoice goes to, to his work address sometimes - via a button would be easier. Would it be easier if these extra addresses were in another table, and if so - how do I get them into the same Invoice No.?

Hope you can help

Link to comment
Share on other sites

There have been a lot of posts regarding invoices in the past on this forum. You might want to use the Search feature and look for Invoice to get started.

First, you must have a relationship setup between the Invoice table and Contact table with contactID as the key.

Secondly you need a script that will store the contactID of interest in a global variable, switch to the Invoice layout, create a new Invoice record and save the global contactID into the Invoice contactID field. At that point the relationship between the Invoice contactId and the contactId on the Contact file becomes viable.

If you want to be able to choose an address on the invoice, I would suggest that you add two fields to the Contact table. The first is a field for the type of invoice address you want to print on the invoice and the second is a calculated field that stores the address associated with the selected invoice address type. The first field will become a radio button attached to a value list with the types of invoice addresses listed (i.e. Home, Work, Friend). When one of the radio button values is selected, the calculated field can be filled in with the address corresponding to that radio button invoice address. In the calculated address field use the Case statement to obtain the value of the radio button and store the associated invoice address into the calculated address. (Use the else option of the Case fucntion to supply a default address).

Then place the calculated address, along with other fields from the Contact file onto the Invoice layout. When you select the Invoice recipient (contactID) the invoice address field will be filled in already, assuming you've selected a invoice address type form the radio button.

Remember that the Invoice layout must use the Invoice table as the underlying data table and the contact information will be supplied through the relationship. The contact information fields on the Invoice layout will look like this ::ContactID, ::Contact_Name, ::Contact_Invoice_Address and so on. The :: inidcates that the field is being supplied via a relationship(in this case from the Contact file).

the Mad Jammer

Link to comment
Share on other sites

Thanks for the help - I have been on the forum for a while, but find that most posts are so specific and it is difficult to see the wood for the trees - thanks for your help - I have success in this part now - I will start on the rest...


Link to comment
Share on other sites

This topic is 6669 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.