2 Replies Latest reply on Sep 1, 2009 12:31 PM by james88

    Drop down list to create new record



      Drop down list to create new record


      I'm new to Filemaker and databases in general so I wouldbe really grateful for help with this problem.


      I've set up a number of tables one of which is called Job and one called Client, it's a many to one relationship - each Job can have only one Client and each Client can have several Jobs. ClientID is a foreign key in the Jobs table.


      I'm working on a layout to create new job records and I what I'd liketo do is to display the client names (from the Client table) in a drop down list from which you can select an existing client OR enter a new client name which creates a new client record in the Client table and places the ClientID into the ClientID field in the Jobs table.


      In the entity relationship between the Jobs and Client table I have ticked on create new records in the Client table.  But the ClientID keeps changing, increasing by increments of 1.


      Any pointers please to get me moving in the right direction, thanks so much.

        • 1. Re: Drop down list to create new record
             Create a value list based on the Client Name field in the Clients table.  On the layout based on the Jobs table, use the 'Client Name' field from the Clients table, and apply the value list to the field.  If you select a client that is already existing, it should not create a new record in the clients table. 
          • 2. Re: Drop down list to create new record
               Thanks for the reply, I've just tried it out and first one created a new record, I commited the change and tried creating a new Job record with the exisiting client name, undortunately it didn't work. I must have an incorrect setting somewhere on the field descriptions, I'll check these again and see if I've done something really silly.  In the meantime if anyone has any other suggestions or things I should check that would be great.  Thanks!