Jump to content

Field contents are duplicating


Greg58

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

Recommended Posts

Hi everyone.  No doubt this probably has a simple fix but I just can't work it out.  I have 2 tables; CARDS and TYPE.  The TYPE table simply has a PK and a 'type' field.  The CARDS table has several fields and is the child to the type table (one TYPE can have many CARDS).  My data entry is on the CARDS table which has a dropdown TYPE field related to the TYPE table.

Problem is when I enter a new card and use one of the dropdown type options such as LYNDA, the LYNDA entry duplicates in the TYPE table.  I end up with numerous LYNDA's and other entries.  Any advice is appreciated.

Thanks

image.png.9a53d074a21f1d44621341ec57cfdce0.png

Link to comment
Share on other sites

Hi Greg

It would be helpful if you could post your database on the forum. It will be something to do with the setup of your relationships probably, in that it is generating entries in the TYPE table when you are choosing the type in the cards table.

If you post the DB then I'm sure I could give you the answer quickly! (or someone else might beat me to it)

Link to comment
Share on other sites

" I have 2 tables; CARDS and TYPE"

Nope. You have two tables; PASSWORDS and TYPE.

Nothing about your design requires TYPE to be unique.

Link to comment
Share on other sites

Based on your original description, I would have expected a file like the one attached. Note the following points:

  • The relationship is based on matching the TypeID and using = as the relational operator;
  • There is no foreign key in the Types table;
  • The selection of type is entered into a local field of the Cards table (which serves as the foreign key to the Types table);
  • The actual type is displayed using a field from the Types table; if you rename a type in the Types table, you will see the change propagated to all cards using the renamed type.

 

CardsDemo.fmp12

  • Like 1
Link to comment
Share on other sites

Thanks for your help.  Still struggling and I think I have messed up my question.  I will start again and thanks for any further help.  You must get sick of we novices asking what no doubt are simple problems.  I have created a new simple demo file called 'CardsMyExample' and uploaded it.  It has two tables TYPE (eg. MasterCard), and CARDS.  My thinking is one Card Type (Mastercard) can have many users (Lyn, Greg, etc).  That is the relationship I have created.

image.png.29b623fa8434b1d9b14a256b50cc74c7.png

But when I add a new record on the CARDS layout and select Mastercard from the Type dropdown list (which is the only option so far) I keep getting new unwanted entries as seen below.

image.png.4d6bbdb0a5ba9a81c64a25800a9d004a.png

Just cannot work this out!!!

CardsMyExample.fmp12

Link to comment
Share on other sites

Please refer to my previous answer. You are trying to select the type by modifying the related Type field.  I said "the selection of type is entered into a local field of the Cards table (which serves as the foreign key to the Types table)" and emphasized that the Type field from Type should be used for display only (it should be non-enterable).

In addition, you have "Allow creation of records ..." checked on both sides of the relationship, neither of which makes sense. 

The net result of these two problems is this: 

  1. You create a new record in the Cards table. 
  2. This new record has no related record in the Types table.
  3. You enter a value into the Types::Type field; this creates a new record in the Types table and populates the _fk_TypeID field of the new Card with the value of  _pk_TypeID of the new Type.

 

Link to comment
Share on other sites

  • 4 months later...

This topic is 1735 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.