I have a nice little data base set up, and I was making a form for new customers details to be added into the system.
I added simple details such as Name, Address etc.
When the users presses save it goes to a new form where the user need to select what the customer wants (What type of phone they want and how many months they want it for)
But Im having trouble setting it up, for it to save into my database table.
You see the field in the contract table includes: Contract ID, Contract Begin Date, Phone ID, Package Type and Customer ID.
Customer ID, Phone ID and Package Type are all foreign Keys.
The problem Im having is with the Contract ID, I want the form to automatically do this with the layout MDC at the start and four other digits following it but allow plusing one to the last ID.
So say the last ID is MDC1087 the next will need to be MDC1088, How will i make the form automatically fill this in.
Another additional problem Im facing is with the Phone ID, I want my user to choose a phone name, which is present in the Phone Table, but i need it to save it to the contract table as it ID, What I want is when the user select a phone, it will show its phone ID, ready for it to save in my contract table.
I added simple details such as Name, Address etc.
When the users presses save it goes to a new form where the user need to select what the customer wants (What type of phone they want and how many months they want it for)
But Im having trouble setting it up, for it to save into my database table.
You see the field in the contract table includes: Contract ID, Contract Begin Date, Phone ID, Package Type and Customer ID.
Customer ID, Phone ID and Package Type are all foreign Keys.
The problem Im having is with the Contract ID, I want the form to automatically do this with the layout MDC at the start and four other digits following it but allow plusing one to the last ID.
So say the last ID is MDC1087 the next will need to be MDC1088, How will i make the form automatically fill this in.
Another additional problem Im facing is with the Phone ID, I want my user to choose a phone name, which is present in the Phone Table, but i need it to save it to the contract table as it ID, What I want is when the user select a phone, it will show its phone ID, ready for it to save in my contract table.