Greg58 Posted March 6, 2019 Posted March 6, 2019 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
rwoods Posted March 6, 2019 Posted March 6, 2019 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)
Greg58 Posted March 7, 2019 Author Posted March 7, 2019 Here it is. Thanks very much. Greg Cards.fmp12
bruceR Posted March 7, 2019 Posted March 7, 2019 " I have 2 tables; CARDS and TYPE" Nope. You have two tables; PASSWORDS and TYPE. Nothing about your design requires TYPE to be unique.
comment Posted March 7, 2019 Posted March 7, 2019 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 1
Greg58 Posted March 10, 2019 Author Posted March 10, 2019 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. 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. Just cannot work this out!!! CardsMyExample.fmp12
comment Posted March 10, 2019 Posted March 10, 2019 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: You create a new record in the Cards table. This new record has no related record in the Types table. 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.
bruceR Posted March 10, 2019 Posted March 10, 2019 As stated by comment; you don't select it using the TYPE field. CardsMyExample MODB.fmp12
Greg58 Posted July 19, 2019 Author Posted July 19, 2019 Not sure I thanked you guys for your help. Sorry for the delay but your advice assisted me immensely.
Recommended Posts
This topic is 2022 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 accountSign in
Already have an account? Sign in here.
Sign In Now