mloucel
Active member
- Local time
- Today, 10:48
- Joined
- Aug 5, 2020
- Messages
- 398
Hello All:
I have a DB that has 2 different sides [now].
- 2 different Offices that must have their own data.
- The BE is 100% similar to each other except for the data contained.
- The FE is Exactly the same for Both, except for the BE
FE for A or B are exactly the SAME except for the name
FE-A and FE-B
BE a and b are exactly the same except for the data.
BE-a and BE-b
My Problem:
How can I SOMEHOW..
Work on my Test DB with a fictional BE [which mimics the production one, up to the path exactly],
then when I move the FE to the production site be able to use some VBA code to re-link the correct BE for the EU.
I have created inside my DB [FE] a settings Table, in that settings table, I am able to locally thru the admin menu enable a Yes/No check mark on ONLY 1 office.
Which I use to display a label on the SPLASH/LOGIN and MENU forms to display the correct Office Name, and is working fine.
THAT IS AS FAR AS I HAVE GONE.
My thought is:
- IF I am able to delete all linked tables in my FE.
- Then provide the End User an updated version of my FE, 1 per-Office
- When The EU opens the NEW updated FE [either FE-A for some and/or FE-B for others]
- The NEW updated FE checks the local settings Table and see which office I previously checked mark.
- Here is MY THOUGHT.. Create some VBA code that re-links the correct BE based on that check mark THE FIRST RUN so that the EU can continue.
-- since is the first time running the FE-A or FE-B will NOT have any linked tables, so on the first run the program must link the tables.
-- Of course there I will add an extra record called LinkedTables, if is True that means the tables are now linked nothing to do, VBA will simply continue, if it is false then Link the tables using VBA
I am not sure if I explain myself what I want to do, but right now I have to link manually and finally distribute the correct FE so that each EU updates their FE with all the Corrections/Updates I made.
I hate to delete all links, then Re-Link all tables,
then save the new corrected/updated FE and distribute.
- I now have 2 exact FE just named FE_A and FE_B
- I Work and update / correct "A" then once that is corrected/Updated I compile and save it as FE_A
== Now I use the same FE-A, delete all links and re-link using BE_b
Compile again the FE but now the new compiled version will be saved as FE_b
Now I have 2 Different files:
FE-A -- Pointing to BE-a
FE-B -- Pointing to BE-b
and is working perfectly.
Since in my test area the BE contains just sample data I created my own sample BE files a and b.
Once the FE is in the EU of course it automatically picks the correct BE, because the Data I linked in my test DB is an exact replica, except for the data.
YES IS WORKING 100%
But the question remains.
Can I simply delete all the linked tables, change LinkedTables in my local settings to FALSE, Change OfficeNumber to 1 or 2 then VBA code to re-link the correct BE using the settings table?
Is this Possible?
Thanks
Maurice.
This code of course will be added to the SPLASH screen
I have a DB that has 2 different sides [now].
- 2 different Offices that must have their own data.
- The BE is 100% similar to each other except for the data contained.
- The FE is Exactly the same for Both, except for the BE
FE for A or B are exactly the SAME except for the name
FE-A and FE-B
BE a and b are exactly the same except for the data.
BE-a and BE-b
My Problem:
How can I SOMEHOW..
Work on my Test DB with a fictional BE [which mimics the production one, up to the path exactly],
then when I move the FE to the production site be able to use some VBA code to re-link the correct BE for the EU.
I have created inside my DB [FE] a settings Table, in that settings table, I am able to locally thru the admin menu enable a Yes/No check mark on ONLY 1 office.
Which I use to display a label on the SPLASH/LOGIN and MENU forms to display the correct Office Name, and is working fine.
THAT IS AS FAR AS I HAVE GONE.
My thought is:
- IF I am able to delete all linked tables in my FE.
- Then provide the End User an updated version of my FE, 1 per-Office
- When The EU opens the NEW updated FE [either FE-A for some and/or FE-B for others]
- The NEW updated FE checks the local settings Table and see which office I previously checked mark.
- Here is MY THOUGHT.. Create some VBA code that re-links the correct BE based on that check mark THE FIRST RUN so that the EU can continue.
-- since is the first time running the FE-A or FE-B will NOT have any linked tables, so on the first run the program must link the tables.
-- Of course there I will add an extra record called LinkedTables, if is True that means the tables are now linked nothing to do, VBA will simply continue, if it is false then Link the tables using VBA
I am not sure if I explain myself what I want to do, but right now I have to link manually and finally distribute the correct FE so that each EU updates their FE with all the Corrections/Updates I made.
I hate to delete all links, then Re-Link all tables,
then save the new corrected/updated FE and distribute.
- I now have 2 exact FE just named FE_A and FE_B
- I Work and update / correct "A" then once that is corrected/Updated I compile and save it as FE_A
== Now I use the same FE-A, delete all links and re-link using BE_b
Compile again the FE but now the new compiled version will be saved as FE_b
Now I have 2 Different files:
FE-A -- Pointing to BE-a
FE-B -- Pointing to BE-b
and is working perfectly.
Since in my test area the BE contains just sample data I created my own sample BE files a and b.
Once the FE is in the EU of course it automatically picks the correct BE, because the Data I linked in my test DB is an exact replica, except for the data.
YES IS WORKING 100%
But the question remains.
Can I simply delete all the linked tables, change LinkedTables in my local settings to FALSE, Change OfficeNumber to 1 or 2 then VBA code to re-link the correct BE using the settings table?
Code:
If LinkedTables = False then
MsgBox "Please wait while maintenance is performed" & vbNewLine _
& "this may take a couple of minutes" & vbNewLine _
& "The program will continue after is done" & vbNewLine _
& "--> DO NOT TURN OFF THE COMPUTER <--"
search for OfficeNumber
Select Case OfficeNumber
Case 1
Link Tables BE-A
Case 2
Link Tables BE-B
End Select
LinkedTables=True
endif
Is this Possible?
Thanks
Maurice.
This code of course will be added to the SPLASH screen