Promotion Database

%3CLINGO-SUB%20id%3D%22lingo-sub-2118904%22%20slang%3D%22en-US%22%3EPromotion%20Database%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2118904%22%20slang%3D%22en-US%22%3E%3CP%3EHaving%20trouble%20with%20some%20parts%20of%20my%20form%20design.%20I'm%20not%20sure%20which%20control%20to%20use%20in%20terms%20of%26nbsp%3B%3CSTRONG%3Epromotion%20to%20allocation%26nbsp%3B%3C%2FSTRONG%3Eas%20this%20has%20a%20one-many%20relationship.%20How%20can%20I%20design%20it%20for%20the%20end-user%20to%20encode%20it%20efficiently%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2118904%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edatabase%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2119573%22%20slang%3D%22en-US%22%3ERe%3A%20Promotion%20Database%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2119573%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F960612%22%20target%3D%22_blank%22%3E%40Nate_Alcantara%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPMFJI%3A%3C%2FP%3E%3CP%3EData%20is%20stored%20in%20tables.%20What%20we%20need%20to%20see%2C%20therefore%2C%20is%20the%20table%20design.%20Thanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2118963%22%20slang%3D%22en-US%22%3ERe%3A%20Promotion%20Database%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2118963%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F459380%22%20target%3D%22_blank%22%3E%40Daniel_Pineault%3C%2FA%3E%26nbsp%3BI%20work%20for%20a%20canned%20goods%20manufacturing%20company%20and%20one%20of%20its%20marketing%20efforts%20is%20creating%20promotions%2Ftrade%20activities.%20Promotion%20to%20allocation%20means%20that%20one%20promotion%20has%20multiple%20accounts%2Fcustomers%20to%20be%20allocated%20to.%20In%20our%20system%2C%20our%20customers%20have%20address%20codes%20so%20I%20have%20a%20table%20for%20this%20plus%20a%20table%20for%20the%20promotion%20details.%3CBR%20%2F%3E%3CBR%20%2F%3EMy%20main%20problem%20is%20in%20terms%20of%20encoding%20for%20the%20end-user%2C%20how%20can%20I%20design%20the%20form%20efficiently%20enough%20that%20multiple%20accounts%20can%20be%20encoded%20per%20promotion%20form.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2118942%22%20slang%3D%22en-US%22%3ERe%3A%20Promotion%20Database%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2118942%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20afraid%20your%20going%20to%20have%20to%20explains%20things%20to%20us%20as%20we%20have%20no%20clue%20what%20you%20are%20referring%20to%20when%20you%20say%20'promotion%20to%20allocation'.%20Please%20explain%20your%20table%20structure%20and%20existing%20form%20design%20and%20what%20you%20are%20now%20trying%20to%20achieve.%20Also%2C%20an%20image%20can%20greatly%20help%20us%20understand%20quickly.%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20general%20terms%2C%20if%20I%20need%20to%20display%20a%20one%20to%20many%20relationship%20in%20a%20form%20of%20be%20using%20a%20subform.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2133296%22%20slang%3D%22en-US%22%3ERe%3A%20Promotion%20Database%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2133296%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F126074%22%20target%3D%22_blank%22%3E%40George%20Hepworth%3C%2FA%3E%26nbsp%3BThese%20are%20my%20table%20designs%20so%20far%20and%20its%20relationship.%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202021-02-14%20192638.png%22%20style%3D%22width%3A%20814px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F254834iC1DF2C8D0B169EAE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202021-02-14%20192638.png%22%20alt%3D%22Screenshot%202021-02-14%20192638.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202021-02-14%20192457.png%22%20style%3D%22width%3A%20559px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F254836i9439675CAB2D814F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202021-02-14%20192457.png%22%20alt%3D%22Screenshot%202021-02-14%20192457.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Screenshot%202021-02-14%20192519.png%22%20style%3D%22width%3A%20555px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F254835i5B476A203FE8400C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Screenshot%202021-02-14%20192519.png%22%20alt%3D%22Screenshot%202021-02-14%20192519.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20need%20help%20on%20how%20to%20design%20the%20form%20in%20terms%20of%20target%20area%20and%20allocation.%20One%20promo%20can%20be%20applicable%20to%20multiple%20areas%20and%20therefore%20have%20multiple%20accounts%20to%20be%20allocated%20to.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2133787%22%20slang%3D%22en-US%22%3ERe%3A%20Promotion%20Database%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2133787%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F960612%22%20target%3D%22_blank%22%3E%40Nate_Alcantara%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOnly%20two%20tables%3F%3C%2FP%3E%3CP%3EI%20see%20at%20least%20three%20or%20four%20others%20that%20could%2C%20and%20probably%20should%2C%20be%20included.%20I%20hope%20you%20have%20at%20least%20these%2C%20plus%20a%20couple%20others%20like%20%22Client%22%20or%20%22Customer%22.%3C%2FP%3E%3CP%3ETarget%20Channel%3CBR%20%2F%3ETarget%20Area%3CBR%20%2F%3EDivision%3CBR%20%2F%3EPromo%20type%3C%2FP%3E%3CP%3EI%20list%20these%20because%20I%20think%20you%20target%20the%20same%20channels%20more%20than%20one.%20I%20would%20expect%20that%20campaigns%20are%20aimed%20at%20the%20same%20target%20areas%20repeatedly.%3CBR%20%2F%3EDivisions%20within%20your%20organization%20should%20be%20listed%20in%20a%20table%20and%20should%20Promo%20Types.%3C%2FP%3E%3CP%3EAll%20of%20these%20would%2C%20I%20believe%2C%20be%20required%20for%20a%20relational%20database%20application.%20You%20may%20have%20them%2C%20of%20course%2C%20and%20only%20showed%20these%20two%2C%20but%20to%20be%20complete%20and%20accurate%20we%20need%20to%20sure%20they%20are%20there.%3C%2FP%3E%3CP%3EA%20few%20notes%20on%20naming%20conventions%20and%20standard%20field%20types%20are%20in%20order%2C%20although%20tangential%20to%20your%20central%20question.%3C%2FP%3E%3CP%3ENames%20should%20not%20have%20spaces%20in%20them%2C%20nor%20should%20other%20non-standard%20characters%20be%20part%20of%20names.%20E.g.%20%23%20or%20%3F%3C%2FP%3E%3CP%3EThese%20names%20are%20acceptable%2C%20but%20clumsy%20because%20anytime%20you%20have%20to%20reference%20one%2C%20you%20must%20enclose%20it%20in%20square%20brackets.%3C%2FP%3E%3CP%3EE.g.%20%5BAddress%20Code%5D%3C%2FP%3E%3CP%3EMost%20long-term%20Access%20developers%20use%20of%20the%20more%20common%20naming%20conventions%20which%20avoid%20spaces%20and%20other%20non-standard%20characters.%3CBR%20%2F%3EA%20second%2C%20much%20more%20problematic%2C%20choice%20is%20the%20use%20of%20a%20Multi-Value%20field%20for%20attachments.%20Again%2C%20experienced%20developers%20do%20not%20use%20this%20field%20type.%20One%2C%20embedded%20photos%20in%20an%20accdb%20causes%20it%20to%20bloat%20needlessly.%20Two%2C%20they%20are%20much%20harder%20to%20work%20with%20in%20the%20interface.%20Instead%2C%20you%20should%20create%20a%20separate%20table%20for%20PromoPhotos.%20It'll%20have%20three%20fields%2C%20i.e.%20those%20you%20have%20in%20the%20MVF%20now.%3C%2FP%3E%3CP%3EOkay%2C%20back%20to%20the%20design.%20I'm%20going%20to%20use%20the%20naming%20convention%20that%20avoids%20spaces%20because%20it%20is%20so%20unpleasant%20to%20try%20to%20work%20with%20them.%20I%20hope%20you%20do%20make%20that%20change.%3C%2FP%3E%3CP%3EYou%20have%20a%20table%20called%20AddressCodes.%20I'd%20call%20it%20AddressCode%20(singular)%2C%20but%20that's%20one%20of%20those%20things%20that%20attracts%20different%20decisions.%20Anyway%2C%20AddressCode%20implies%20that%20you%20are%20concerned%20with%20Addresses%20as%20the%20primary%20%22fact%22%20about%20your%20promomotions.%20I%20see%20three%20other%20fields%20in%20it%2C%20though%2C%20that%20really%20make%20me%20wonder.%20%22ParentName%22%2C%20%22RetailChain%22%20and%20%22Channel%22.%20Parent%20of%20what%3F%20Do%20you%20have%20a%20separate%20table%20of%20%22Parents%22%3F%20How%20about%20%22RetailChain%22%3F%20Is%20there%20a%20separate%20%22RetailChain%22%20table%3F%20If%20not%2C%20then%20both%20of%20them%20should%20be%20created%20and%20properly%20related%20via%20Primary%20and%20Foreign%20Key%20fields.%20Looking%20at%20%22AddressName%22%20I%20have%20to%20ask%20if%20you%20have%20a%20separate%20table%20with%20street%2C%20city%2C%20and%20state%20details%3F%20Or%20are%20you%20only%20interested%20in%20names%20of%20addresses%2C%20which%20I%20would%20imagine%20might%20be%20something%20like%20%22The%20Main%20Downtown%20Mall%22%3F%3CBR%20%2F%3ENow%20to%20the%20TradeActivities%20table.%20The%20Primary%20Key%20in%20it%20is%20PromoID.%20Does%20that%20mean%20TradeActivity%20is%20a%20synonym%20for%20Promotion%3F%20If%20not%2C%20how%20are%20they%20related%3F%20If%20so%2C%20why%20two%20different%20names%3F%3C%2FP%3E%3CP%3EOne%20last%20question%20that%20I%20think%20you%20probably%20addressed%2C%20but%20which%20I'd%20like%20to%20clarify.%20What%20goes%20into%20the%20field%20called%20%22Allocation%22%3F%20Is%20that%20a%20number%2C%20a%20percentage%2C%20or%20perhaps%20something%20else%3F%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Having trouble with some parts of my form design. I'm not sure which control to use in terms of promotion to allocation as this has a one-many relationship. How can I design it for the end-user to encode it efficiently?

9 Replies

I'm afraid your going to have to explains things to us as we have no clue what you are referring to when you say 'promotion to allocation'. Please explain your table structure and existing form design and what you are now trying to achieve. Also, an image can greatly help us understand quickly.

In general terms, if I need to display a one to many relationship in a form of be using a subform.

@Daniel_Pineault I work for a canned goods manufacturing company and one of its marketing efforts is creating promotions/trade activities. Promotion to allocation means that one promotion has multiple accounts/customers to be allocated to. In our system, our customers have address codes so I have a table for this plus a table for the promotion details.

My main problem is in terms of encoding for the end-user, how can I design the form efficiently enough that multiple accounts can be encoded per promotion form. 

@Nate_Alcantara 

 

PMFJI:

Data is stored in tables. What we need to see, therefore, is the table design. Thanks.

@George Hepworth These are my table designs so far and its relationship. Screenshot 2021-02-14 192638.pngScreenshot 2021-02-14 192457.pngScreenshot 2021-02-14 192519.png

I need help on how to design the form in terms of target area and allocation. One promo can be applicable to multiple areas and therefore have multiple accounts to be allocated to.

@Nate_Alcantara 

Only two tables?

I see at least three or four others that could, and probably should, be included. I hope you have at least these, plus a couple others like "Client" or "Customer".

Target Channel
Target Area
Division
Promo type

I list these because I think you target the same channels more than one. I would expect that campaigns are aimed at the same target areas repeatedly.
Divisions within your organization should be listed in a table and should Promo Types.

All of these would, I believe, be required for a relational database application. You may have them, of course, and only showed these two, but to be complete and accurate we need to sure they are there.

A few notes on naming conventions and standard field types are in order, although tangential to your central question.

Names should not have spaces in them, nor should other non-standard characters be part of names. E.g. # or ?

These names are acceptable, but clumsy because anytime you have to reference one, you must enclose it in square brackets.

E.g. [Address Code]

Most long-term Access developers use of the more common naming conventions which avoid spaces and other non-standard characters.
A second, much more problematic, choice is the use of a Multi-Value field for attachments. Again, experienced developers do not use this field type. One, embedded photos in an accdb causes it to bloat needlessly. Two, they are much harder to work with in the interface. Instead, you should create a separate table for PromoPhotos. It'll have three fields, i.e. those you have in the MVF now.

Okay, back to the design. I'm going to use the naming convention that avoids spaces because it is so unpleasant to try to work with them. I hope you do make that change.

You have a table called AddressCodes. I'd call it AddressCode (singular), but that's one of those things that attracts different decisions. Anyway, AddressCode implies that you are concerned with Addresses as the primary "fact" about your promomotions. I see three other fields in it, though, that really make me wonder. "ParentName", "RetailChain" and "Channel". Parent of what? Do you have a separate table of "Parents"? How about "RetailChain"? Is there a separate "RetailChain" table? If not, then both of them should be created and properly related via Primary and Foreign Key fields. Looking at "AddressName" I have to ask if you have a separate table with street, city, and state details? Or are you only interested in names of addresses, which I would imagine might be something like "The Main Downtown Mall"?
Now to the TradeActivities table. The Primary Key in it is PromoID. Does that mean TradeActivity is a synonym for Promotion? If not, how are they related? If so, why two different names?

One last question that I think you probably addressed, but which I'd like to clarify. What goes into the field called "Allocation"? Is that a number, a percentage, or perhaps something else?

Thanks.

@George Hepworth Hi there. I updated my database and relationships based on your suggestions (See attached photos)

Allocation means the amount of products (in cases) to be given to our customers. Which means that 1 Promotion = Many Customer allocations. My problem is I need to figure out a way how I can encode the allocation part in the Trade Activity Entry Form I designed.

I also need help in fields that need to have multiple selections and I don't know how to do that. The two fields are Target Area and Channel Type.

 

Thanks so much for all your help!!

 

Screenshot 2021-02-21 214825.png

@Nate_Alcantara 

This certainly looks more appropriate.

 

Some questions and a strong suggestion, the suggestion first. You should always enforce Referential Integrity on relationships, so Divisions, etc., which do not show that, need to be modified to show that relationship to Trade Activities. 

That said, before you actually do that let's address some questions about it.

 

Is it true that each Trade Activity is mounted for a single Division? For a Single Channel? etc. The way the four tables on the left are set up with the join to Trade Activities, that is how it would have to be. E.g. If DivID for "Division A" is stored in the DivID field for a specific Trade Activity, that means one and only one division is participating in that Trade Activity. Is that accurate? Or, does a Trade Activity involve multiple Divisions? If the former, this is a proper design, but needs to have the relationship on DivID needs to have Referential Integrity (RI) enforced. If not, we need an intermediary table between Divisions and Trade Activities. This is usually referred to as a Junction Table. These tables include--at a minimum--two fields, the Primary Key from a Trade Activity and the Primary Key from a Division. That allows you to record one or more Trade Activities for each Division, and one or more Divisions with each Trade Activity. 
Again, the decision reflects how your business rules apply.

The same is true for other related tables, such as Area Coverage. If one Trade Activity is set up for one Area, this is correct as shown (with RI enforced). However, if one Trade Activity can be set up for one ore more areas, then you need that Junction Table as described above.

 

The same question applies to Volume Allocation. If it's a one to many (one allocation for each trade activity) the current design is correct. However, if there are different allocations for different customers in a single trade activity, again a junction table is needed.

So, the business rules determine what needs to be adjusted, if anything. 

Hi @George Hepworth. Here are the summarized relationships.

 

1 Trade Activity = 1 Division (Essentially, under a division, there are several trade activities)

1 Trade Activity = Many Channels

1 Trade Activity = Many Areas

1 Trade Activity = Many Volume Allocations

 

What are your suggestions on this?

@Nate_Alcantara 

Thanks for the details. When each trade activity is undertaken on behalf of a single division, but each division can engage in multiple trade activities, that is a one-to-many relationship: one division to many trade activities. Your current diagram shows that properly, but, as previously noted, you should enforce Referential Integrity. 


The other three appear to be many-to-many relationships. One trade activity can be conducted through many channels. One channel can be used in many trade activities, and so on for the other two.

 

The way we handle this is a junction table. It has at a minimum two fields. One is the TradeActivityID and the other is the ChannelID. In this junction, perhaps called TradeActivityChannel, the TradeActivityID is a foreign key to the TradeActivityID primary key in the TradeActivity table, and the ChannelID is a foreign key to the ChannelID primary key in the Channel table. In the TradeActivityChannel, these two fields together make up the primary key for that table. We usually refer to these as a Composite Primary Key. Sometimes additional fields are included, such as a DateEffective or DateEnded field if there is a time limit involved.

The same thing applies to the other two tables with many-to-many relationships.

 

The interface for these relationships will be a main form with subforms. Rather than try to explain it, I'll offer an example.