link record to another record in the same table (1 Viewer)

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:11
Joined
May 21, 2018
Messages
8,529
Two things
1. rsProcessed!RoyaltyAgent_ID_FK = DLookup("agentPK", "tblAgents", "AgentName = 'Capital'")
This line needs to have the correct name of the Main Agency.
If the main agency is Captial1 then this has to match.
They do not currently match

2. The rule is that if the inactive date is LESS THAN the process date then the royalties go to the Main.
You had it equal.

3. If you want to make the rule LESS THAN OR EQUAL then change this to

If InActiveDate < Date Then
to
If InActiveDate <= Date Then
 

stefanocps

Registered User.
Local time
Today, 16:11
Joined
Jan 31, 2019
Messages
153
aahh yes..of course i know name must be the same..just made a mistake. I think this was the only problem as the inactive date was earlier then the sale date and processed date.
Now works..just correcting the name
Why the details organization of the structure is not shwown anyway?

One more thing, important..there are some tables like the processed one that are going to be quite long..not easy to scroll.What could i do?
i want to move some tables from the pages to make more room but i see it is not possible without editing code
For example the firstpage, agent and commission, i wanted to move those table regarding the structure to another page..but if i move them the db break
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:11
Joined
May 21, 2018
Messages
8,529
For example the firstpage, agent and commission, i wanted to move those table regarding the structure to another page..but if i move them the db break
You should be able to add, edit, or delete pages without problem. Moving a subform to a different page should not break anything.
One more thing, important..there are some tables like the processed one that are going to be quite long..not easy to scroll.What could i do?
It is a data sheet so you can sort, filter the list as you want from the pulldowns
Filter by sale date, filter by Seller, Filter by Royalty agent.
filter.png


Why the details organization of the structure is not shwown anyway?
Can you take a screen capture of this issue. It works for me so maybe we are not talking about the same thing.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:11
Joined
May 21, 2018
Messages
8,529
Moving a subform to a different page is a little tricky. You have to make sure you select the page and not the outside tab control. See how the page is selected not the outside.

page.png
 

stefanocps

Registered User.
Local time
Today, 16:11
Joined
Jan 31, 2019
Messages
153
ok i se the issue with the organization is when i made more change the same day of work...they are not reflected. ig i change the pc date to tomorrow and male a change then i see it-.-.but if i make another change without changing again the pc date to the next daythis chage is not shown...

i tried to cut and paste in another page not a subform but those window in the first page that contains the structure datas..and this break the db in my test
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:11
Joined
May 21, 2018
Messages
8,529
ok i se the issue with the organization is when i made more change the same day of work...they are not reflected. ig i change the pc date to tomorrow and male a change then i see it-.-.but if i make another change without changing again the pc date to the next daythis chage is not shown.
It is purposely set up to only save one day's changes. That way if you add 3 people in one day you do not save three archives.

i tried to cut and paste in another page not a subform but those window in the first page that contains the structure datas..and this break the db in my test
When you copy and paste the copy gets a new name, so you are correct it may break some things. You would have to ensure that if the names change you rename to the old names. You may also have to ensure the event procedure are still connected using [Event Procedure].

Might be easier if you tell me where to move things, and I will move for you.
 

stefanocps

Registered User.
Local time
Today, 16:11
Joined
Jan 31, 2019
Messages
153
acrtually better to move the 2 windows in processed sales in a new page before report..so thesales will have more room(i am thinking to latop user)
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:11
Joined
May 21, 2018
Messages
8,529
Try this. Moved the two subforms with summary data.
 

Attachments

  • Capital 4.accdb
    1.3 MB · Views: 62

stefanocps

Registered User.
Local time
Today, 16:11
Joined
Jan 31, 2019
Messages
153
hello i am trying to resize for laptop use..which is very different for the size of mask
First question...is there a general rule to make the mask look good for a desktop and for a laptop?
I have set the mask to "customizable" dimension, and i can make it smaller or bigger....but if i make i smaller i get the scrolling bar and that cna be annoying..for example scroll just to get the buttn CLOSE, while i would rather get the whole mask resizing,content included
how can i manage this?
thanks
 

stefanocps

Registered User.
Local time
Today, 16:11
Joined
Jan 31, 2019
Messages
153
by the way, just discovered that the new mask which is supposed to delete the whole database infact don't delete it all
I upload the db which contans my last edit..and see the table that are still populated after i have delete them with the delete mask
 

Attachments

  • Capital 4.accdb
    1.3 MB · Views: 55

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:11
Joined
May 21, 2018
Messages
8,529
In the queries
qryDeleteAllAgentArchive
qryDeleteAllArchive

I still had the date() in the WHERE criteria . You can remove that or use this version of those queries.
There are two similar queries without the word "All" in the name
qryDeleteAgentArchive
qryDeleteArchive

These two need the date. They are used so that you only save the most current change for the current day. If not you would get an archive for every change you make, and not the final change for the day.
 

Attachments

  • Capital 5.accdb
    1.2 MB · Views: 69

stefanocps

Registered User.
Local time
Today, 16:11
Joined
Jan 31, 2019
Messages
153
In the queries
qryDeleteAllAgentArchive
qryDeleteAllArchive

I still had the date() in the WHERE criteria . You can remove that or use this version of those queries.
There are two similar queries without the word "All" in the name
qryDeleteAgentArchive
qryDeleteArchive

These two need the date. They are used so that you only save the most current change for the current day. If not you would get an archive for every change you make, and not the final change for the day.
let me understand..if i use the form clear old data now..do i delete all at once now?
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:11
Joined
May 21, 2018
Messages
8,529
Yes it should if you use version 5.
 

stefanocps

Registered User.
Local time
Today, 16:11
Joined
Jan 31, 2019
Messages
153
something funny, at least for me, happen with this report
rptProcessedBySale

This report has a field too small "OrganizationEffectiveDate", so i mve a little to the right the royaltyes note field, iand i enlarge a little the effective date
After that the report don'open anymore...
i don't do anything to data or to link or code...why happen this?

p.s. actually it is opne the report as if i try to rename it it says that i should close it first... but i don'see it nowhere
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:11
Joined
May 21, 2018
Messages
8,529
The report is probably open, but minimized for some reason. Why it is doing that I do not know.
You could put this code in the form's on open event
Docmd.Maximize.
 

stefanocps

Registered User.
Local time
Today, 16:11
Joined
Jan 31, 2019
Messages
153
The report is probably open, but minimized for some reason. Why it is doing that I do not know.
You could put this code in the form's on open event
Docmd.Maximize.
i thought also that is open but really cannot find anywhere. Also why it does like that only after that small edit?anyway with this command it works..it open it full size which is not very nice but it opens!
 
Last edited:

stefanocps

Registered User.
Local time
Today, 16:11
Joined
Jan 31, 2019
Messages
153
one question, it will require a bit of edit if it can be done is nice otherwise can stille manage
Datas that are feeded in the db comes from the website where final clients register using a code
So for example the client STEFANO if register through the invitation of the main agency (CAPITAL1) will input the code CPT1to unlock the registration
If Paul is a affiliated to CAPITAL1 will have CPT1A1, and his affiiate will have CPT1A2 and so on
If peter is another affiliate to CAPITAL1 he will get the code CPT1B1, and his affiliate CPT1B2

and so on
so the cpt1 identify the main, and then allò the first level will have CPT1 + A1, B1,C1...Z1
All second level CPT1 + (A1,B1,..Z1) +A2 or B2 ..Z2

At site level i have all the registration where i can find that a certain user has registered using a certain code..so at the end of month when royalties has to be assigned, i 'll look for the clint name, see what code is..and check in another place what agent is associated to that code
So unless i can find a much more evolute plugin for wordpress doing this..i would like to save at least the last step
To use that code straight in the db you build
That will require that when insert an agent name i ll insert his code also
SO when i insert sales for example i just insert the code the come from the website

I think a very easy way to do could be to use the website code instead of the name and add a field in the ahgent table for the real name..so that i work withj code but i will always get the nbame displayed...
does it make sense?

note that the coding i have written above..it is not mandatory...can be any type for better suite the need
 

stefanocps

Registered User.
Local time
Today, 16:11
Joined
Jan 31, 2019
Messages
153
if my idea i have explained can work i think i can do it by myself also
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:11
Joined
May 21, 2018
Messages
8,529
If I understand correctly in the Agents table an Agent has a Code. Every sale has a code so you can link a sale to an Agent by the code and import these into the sales table.
 

stefanocps

Registered User.
Local time
Today, 16:11
Joined
Jan 31, 2019
Messages
153
i am not sure if we are talink the same thing. Let's make it simplier
I want to use a code instead of agent name for the operation in the db
Instead to put the sale to , let's say, Paul, i want to use his code..let's say ABC. Of course i want to see the nalme also, but i'd rather input data using the code

i have made some modification in the db, i use the agent name field with a code and added a field where i put the name..though in some table i need to make appear this last field

By the way..it seems i have found a bug?
if a i add a sale with a dae older than today , thi sale will not be "recognized"..i cannot process it

so i attach the db called test just to show you the code/name thing i am doing (and if you think it is fine i might do the same on the actual db)

then i attach the actual db(Capital 1) if you need ot modify the issue of sales older than today
 

Attachments

  • Capital1.accdb
    1.3 MB · Views: 55
  • TEST.accdb
    1.3 MB · Views: 63

Users who are viewing this thread

Top Bottom