Go Back   Access World Forums > Microsoft Access Reference > Code Repository

 
Reply
 
Thread Tools Rating: Thread Rating: 5 votes, 4.60 average. Display Modes
Old 06-09-2014, 05:49 AM   #1
Frothingslosh
Premier Pale Stale Ale
 
Frothingslosh's Avatar
 
Join Date: Oct 2012
Location: Flint, Michigan, USA
Posts: 2,879
Thanks: 71
Thanked 402 Times in 363 Posts
Frothingslosh will become famous soon enough Frothingslosh will become famous soon enough
Front End Auto-Update

We've seen a number of requests lately about automatically distributing database front end files after a new version is released. This is a modified version of code taken elsewhere on the web; I did not write the vast majority of it, only making a couple updates (mainly to keep the code from deleting the front-end if the file is run with no network connection).

Edit: I have been told the original code is by Bob Larson, just to give credit where credit is due.

To make it work, you need:
  1. A table in the front end called tbl-fe_version, with a field fe_version_number.
  2. A table linked into the front end called tbl-version_fe_master, with a field fe_version_number.
  3. A table linked into the front end called tbl-version_master_location, with a field s_masterlocation.
Tables 2 and 3 can be in either the back end or in a completely separate file. You can also use different names for the tables and/or fields, as long as you update the correct references in the code.

The way it works is that the tool first checks to see if the master file is the one being executed by comparing the path of the currently running version of your application against the master location from 3 above. If a local copy is being run instead, it then compares version numbers. If they do not match, it writes a batch file that will delete the local copy of the tool, then copy the master copy from the folder at 3 above, and then restart your application.

Word of warning - make absolutely sure your master copy has the same version number as is found in 2, or you will wind up stuck in a delete/update loop.

Anyway, here's the code for the version checker:

Code:
Public Function CheckFrontEnd() As Integer
' ************************************************************
' Created by       : Scott L Prince
' Parameters       : None
' Result           : Determines if backend can be reached, and if front end is the current version.
' Returns          : 0 - Misc Error
'                  : 1 - No current version found in Version Manager file
'                  : 2 - Front end being run from master location
'                  : 3 - Master file path not found in Version Manager file
'                  : 999 - Front end current
' Date             : 5-30-14
' Remarks          : Based on previously-existing code by Bob Larson posted at StackOverflow
' Changes          :
' ************************************************************
Dim FrontEndVersion As String               'Front end version number
Dim MasterVersion As String                 'Master version number
Dim MasterPath As String                    'Location of the master FE file
Dim BatchPath As String                     'Location of the batch file that does the actual update
 
    'Determine master version number.
    MasterVersion = DLookup("fe_version_number", "tbl-version_fe_master")
 
    'Determine if the database containing the version information can be accessed.
    Select Case MasterVersion
        Case ""                             'Master version number cannot be found, or backend/version manager is missing.
 
            CheckFrontEnd = 1
 
        Case Else                           'Version data found.
 
            'Look up the path for the master file location.
            MasterPath = DLookup("s_masterlocation", "tbl-version_master_location")
 
            'Determine if the master file is being run rather than a local copy.
            If Nz(MasterPath, "") = "" Then
 
                'No master path was found.  Return error value.
                CheckFrontEnd = 3
 
            ElseIf MasterPath = CurrentProject.Path Then
 
                'The actual master file is the one being executed.
                CheckFrontEnd = 2
 
            Else
 
              'Master file path found and is not being run.  Determine the version number of the active front end.
                FrontEndVersion = DLookup("fe_version_number", "tbl-fe_version")
 
              'Compare the version number in the front end to the master version number.
                Select Case (FrontEndVersion = MasterVersion)
 
                    Case True           'Version numbers match.
 
                        'Return "OKAY" result.
                        CheckFrontEnd = 999
 
                    Case False         'Version numbers do not match.
 
                      'Create the path for the batch file used to update the front end.
                        BatchPath = CurrentProject.Path & "\UpdateDbFE.cmd"
 
                        'Check for an already-existing BatchPath, and kill it if it exists.
                        If Dir(BatchPath) <> "" Then Kill BatchPath
 
                        'Notify the user that the application will update.
                        MsgBox "UPDATE REQUIRED" & vbCrLf & vbCrLf & _
                        "Your program is not the latest version." & vbCrLf & vbCrLf & _
                        "The front-end needs to be updated. The program will now close and then should reopen automatically.", _
                        vbCritical
 
                        'Execute 'UpdateFrontEnd'.
                        UpdateFrontEnd CurrentProject.Path & "\" & CurrentProject.Name, MasterPath
 
                End Select
            End If
    End Select
 
End Function
And this is the code for the actual update program. It should be in the same module as the version checking program. It has been tightened up slightly from the original, and reliance on module-level declarations has been removed. The batch file has also been cleaned up.

Code:
Private Sub UpdateFrontEnd(ByVal LocalFilePath As String, _
                 ByVal MasterFileFolder As String)
 
Dim BatchFile As String
Dim MasterFilePath As String
Dim Restart As String
 
    'Set the file name and location for the file to copy
    MasterFilePath = MasterFileFolder & "\" & CurrentProject.Name
    'Set the file name of the batch file to create
    BatchFile = CurrentProject.Path & "\UpdateDbFE.cmd"
    'Set the restart file name
    Restart = """" & LocalFilePath & """"
 
'Create the batch file
    Open BatchFile For Output As #1
    Print #1, "@Echo Off"
    Print #1, "ECHO Deleting old file..."
    Print #1, ""
    Print #1, "ping 127.0.0.1 -n 5 -w 1000 > nul"
    Print #1, ""
    Print #1, "Del """ & LocalFilePath & """"
    Print #1, ""
    Print #1, "ECHO Copying new file..."
    Print #1, "Copy /Y """ & MasterFilePath & """ """ & LocalFilePath & """"
    Print #1, ""
    Print #1, "ECHO Starting Microsoft Access..."
    Print #1, "START /I " & """MSAccess.exe"" " & Restart
    Close #1
 
  'Run the batch file
    Shell BatchFile
 
  'Close the current application so batch file can execute.
    DoCmd.Quit
End Sub


Last edited by Frothingslosh; 09-26-2014 at 04:10 AM.
Frothingslosh is offline   Reply With Quote
The Following 10 Users Say Thank You to Frothingslosh For This Useful Post:
AndrewS (04-24-2018), BlueIshDan (06-09-2014), hardsoft (07-13-2017), hassanogaibi (06-28-2016), NauticalGent (02-15-2016), nosferatu26 (02-27-2017), papan36125 (03-31-2015), rgrimes (01-08-2015), Sketchin (09-23-2014), sneuberg (12-06-2016)
Old 08-18-2014, 12:56 PM   #2
Sean75db
Newly Registered User
 
Join Date: May 2014
Posts: 33
Thanks: 6
Thanked 1 Time in 1 Post
Sean75db is on a distinguished road
Re: Front End Auto-Update

Thank you for posting th coding, this just what i need for my DB, i am some what new to VBA coding and i am not sure about implamenting this module in my DB i have made the table and all of that. it isn't working for me and i am wondering if you would have any ideas as to what i might have missed. i copyied the coding built the tables and put in the version numbers.
Sean75db is offline   Reply With Quote
The Following User Says Thank You to Sean75db For This Useful Post:
hassanogaibi (06-28-2016)
Old 03-31-2015, 07:07 AM   #3
papan36125
Newly Registered User
 
Join Date: Feb 2015
Posts: 1
Thanks: 2
Thanked 0 Times in 0 Posts
papan36125 is on a distinguished road
Re: Front End Auto-Update

Quote:
Originally Posted by Frothingslosh View Post
We've seen a number of requests lately about automatically distributing database front end files after a new version is released. This is a modified version of code taken elsewhere on the web; I did not write the vast majority of it, only making a couple updates (mainly to keep the code from deleting the front-end if the file is run with no network connection).

Edit: I have been told the original code is by Bob Larson, just to give credit where credit is due.

To make it work, you need:
  1. A table in the front end called tbl-fe_version, with a field fe_version_number.
  2. A table linked into the front end called tbl-version_fe_master, with a field fe_version_number.
  3. A table linked into the front end called tbl-version_master_location, with a field s_masterlocation.
Tables 2 and 3 can be in either the back end or in a completely separate file. You can also use different names for the tables and/or fields, as long as you update the correct references in the code.

The way it works is that the tool first checks to see if the master file is the one being executed by comparing the path of the currently running version of your application against the master location from 3 above. If a local copy is being run instead, it then compares version numbers. If they do not match, it writes a batch file that will delete the local copy of the tool, then copy the master copy from the folder at 3 above, and then restart your application.

Word of warning - make absolutely sure your master copy has the same version number as is found in 2, or you will wind up stuck in a delete/update loop.

Anyway, here's the code for the version checker:

Code:
Public Function CheckFrontEnd() As Integer
' ************************************************************
' Created by       : Scott L Prince
' Parameters       : None
' Result           : Determines if backend can be reached, and if front end is the current version.
' Returns          : 0 - Misc Error
'                  : 1 - No current version found in Version Manager file
'                  : 2 - Front end being run from master location
'                  : 3 - Master file path not found in Version Manager file
'                  : 999 - Front end current
' Date             : 5-30-14
' Remarks          : Based on previously-existing code by Bob Larson posted at StackOverflow
' Changes          :
' ************************************************************
Dim FrontEndVersion As String               'Front end version number
Dim MasterVersion As String                 'Master version number
Dim MasterPath As String                    'Location of the master FE file
Dim BatchPath As String                     'Location of the batch file that does the actual update
 
    'Determine master version number.
    MasterVersion = DLookup("fe_version_number", "tbl-version_fe_master")
 
    'Determine if the database containing the version information can be accessed.
    Select Case MasterVersion
        Case ""                             'Master version number cannot be found, or backend/version manager is missing.
 
            CheckFrontEnd = 1
 
        Case Else                           'Version data found.
 
            'Look up the path for the master file location.
            MasterPath = DLookup("s_masterlocation", "tbl-version_master_location")
 
            'Determine if the master file is being run rather than a local copy.
            If Nz(MasterPath, "") = "" Then
 
                'No master path was found.  Return error value.
                CheckFrontEnd = 3
 
            ElseIf MasterPath = CurrentProject.Path Then
 
                'The actual master file is the one being executed.
                CheckFrontEnd = 2
 
            Else
 
              'Master file path found and is not being run.  Determine the version number of the active front end.
                FrontEndVersion = DLookup("fe_version_number", "tbl-fe_version")
 
              'Compare the version number in the front end to the master version number.
                Select Case (FrontEndVersion = MasterVersion)
 
                    Case True           'Version numbers match.
 
                        'Return "OKAY" result.
                        CheckFrontEnd = 999
 
                    Case False         'Version numbers do not match.
 
                      'Create the path for the batch file used to update the front end.
                        BatchPath = CurrentProject.Path & "\UpdateDbFE.cmd"
 
                        'Check for an already-existing BatchPath, and kill it if it exists.
                        If Dir(BatchPath) <> "" Then Kill BatchPath
 
                        'Notify the user that the application will update.
                        MsgBox "UPDATE REQUIRED" & vbCrLf & vbCrLf & _
                        "Your program is not the latest version." & vbCrLf & vbCrLf & _
                        "The front-end needs to be updated. The program will now close and then should reopen automatically.", _
                        vbCritical
 
                        'Execute 'UpdateFrontEnd'.
                        UpdateFrontEnd CurrentProject.Path & "\" & CurrentProject.Name, MasterPath
 
                End Select
            End If
    End Select
 
End Function
And this is the code for the actual update program. It should be in the same module as the version checking program. It has been tightened up slightly from the original, and reliance on module-level declarations has been removed. The batch file has also been cleaned up.

Code:
Private Sub UpdateFrontEnd(ByVal LocalFilePath As String, _
                 ByVal MasterFileFolder As String)
 
Dim BatchFile As String
Dim MasterFilePath As String
Dim Restart As String
 
    'Set the file name and location for the file to copy
    MasterFilePath = MasterFileFolder & "\" & CurrentProject.Name
    'Set the file name of the batch file to create
    BatchFile = CurrentProject.Path & "\UpdateDbFE.cmd"
    'Set the restart file name
    Restart = """" & LocalFilePath & """"
 
'Create the batch file
    Open BatchFile For Output As #1
    Print #1, "@Echo Off"
    Print #1, "ECHO Deleting old file..."
    Print #1, ""
    Print #1, "ping 127.0.0.1 -n 5 -w 1000 > nul"
    Print #1, ""
    Print #1, "Del """ & LocalFilePath & """"
    Print #1, ""
    Print #1, "ECHO Copying new file..."
    Print #1, "Copy /Y """ & MasterFilePath & """ """ & LocalFilePath & """"
    Print #1, ""
    Print #1, "ECHO Starting Microsoft Access..."
    Print #1, "START /I " & """MSAccess.exe"" " & Restart
    Close #1
 
  'Run the batch file
    Shell BatchFile
 
  'Close the current application so batch file can execute.
    DoCmd.Quit
End Sub
Hello,

I have a question. i am currently building a multi user Access application at work. You code is perfect for that. Can I use this as part of a Business Application?

Regards,

Arka

papan36125 is offline   Reply With Quote
Old 05-16-2015, 09:27 AM   #4
JLCantara
Newly Registered User
 
Join Date: Jul 2012
Location: Montréal, Qc.
Posts: 335
Thanks: 30
Thanked 48 Times in 47 Posts
JLCantara is on a distinguished road
Re: Front End Auto-Update

Hi Sean!
I solved this problem a long time ago using this very simple solution: a scheduled job was run daily, the plant was operating 24/7, at 12:12 every day. It was checking on the server if a new version was available and if so, a copy to local PC was made. On my PC, I had another SJ running at 1:30 deleting the server version of the apps (almost 2000 objects).

Good luck, JLCantara.
JLCantara is offline   Reply With Quote
Old 05-23-2015, 05:02 PM   #5
princeade
Newly Registered User
 
Join Date: May 2015
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
princeade is on a distinguished road
Re: Front End Auto-Update

Hello Frothingslosh:
I added your code in a module and compile it. There is a

"COMPILE ERROR" - Sub or function not defined.

Kindly upload a small sample of your version checker (any version up to Access 2013 can be uploaded here).

I'm the second person requesting your sample due to error. Another person (Sean75db) who posted earlier in the thread also asked for a sample. It will be appreciated if you would upload a small sample. Thank you.
princeade is offline   Reply With Quote
Old 05-23-2015, 05:05 PM   #6
princeade
Newly Registered User
 
Join Date: May 2015
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
princeade is on a distinguished road
Re: Front End Auto-Update

Addionally, the compile error highlighted "UpdateFrontEnd "
This means that "UpdateFrontEnd " is not defined in your module.
Thanks in advance.
princeade is offline   Reply With Quote
Old 07-09-2015, 08:58 AM   #7
GBalcom
Much to learn!
 
Join Date: Jun 2012
Location: Georgia
Posts: 381
Thanks: 20
Thanked 2 Times in 2 Posts
GBalcom is on a distinguished road
Re: Front End Auto-Update

Has this been proven with MS Access Runtime on the Front Ends?

GBalcom is offline   Reply With Quote
Old 09-04-2015, 12:16 PM   #8
GrandMasterTuck
In need of medication
 
Join Date: May 2013
Posts: 129
Thanks: 74
Thanked 10 Times in 7 Posts
GrandMasterTuck is on a distinguished road
Re: Front End Auto-Update

This is a great module that works wonderful, but I wanted to let people know you can do the version checking without using VBA, and simply have an Updater application that runs the VBA to delete your local copy and download the fresh version off the server.

I use a table called AppConstants on the server's backend that has two columns: ConstantTitle and ConstantValue. One of the rows has ConstantTitle set to "AppVersion" and ConstantValue set to the version number.

Then I have a field with visibility set to False on my main form called VersionNo, and I set this field's value to ="VersionNumber" (where VersionNumber is the actual version number, e.g. ="1.25"). On the Main Form's OnLoad event, I have a macro that runs a DLookup in an IF command:

if DLookUp("[ConstantValue]", "tblAdmin", "[ConstantTitle]='AppVersion'")<>[Forms]![frmMain]![VersionNo] Then RunCode OpenUpdater()
Quit Access
End If

The code for OpenUpdater:
Code:
Function OpenUpdater()  'This sets the name of the code to call later
Dim accapp As Access.Application
Set accapp = New Access.Application
accapp.OpenCurrentDatabase ("C:\$Data\MyUpdater.accde")  'Starts up this file
accapp.Visible = True
End Function
What it's doing: The macro checks the value of the VersionNumber in the table on the server. When I update the app copy on the server, I set a new version number in here and set my app copy's VersionNo field to the same number. When you're running the old version, your app sees that the version numbers don't match, and then it executes the Macro's 'Then' commands: it runs the OpenUpdater code and shuts itself off.

The OpenUpdater code simply starts the MyUpdater.accde program, which is by default installed on the user's PC along with the application itself. The OpenUpdater program executes the following code:

Code:
DoCmd.ShowToolbar "Ribbon", acToolbarNo

'Copy the new version to the C drive
Dim SourceFile, DestinationFile As String
    SourceFile = "Z:\Server\MyProgram.accde"   'Where to get the fresh copy
    DestinationFile = "C:\$Data\MyProgram.accde"   'Where to put it
    With CreateObject("Scripting.FileSystemObject")
    .copyfile SourceFile, DestinationFile, True    'This line does the acual copy and paste
End With

'Reopen MyProgram
Dim accapp As Access.Application
Set accapp = New Access.Application
accapp.OpenCurrentDatabase ("C:\$Data\MyProgram.accde")
accapp.Visible = True
End Function
This Function is called in a Macro within MyUpdater, and the command just after the RunCode in this Macro is QuitAccess, which shuts off the Updater.

So my main program, when you open the main form, checks the version number on the server. If they're different, the main program starts the updater and then shuts itself down. The updater copies the fresh version off the server and pastes it in the correct place on the C drive, then starts up the program and shuts itself down.

From the end-user's perspective, the program starts, immediately quits, and then starts again a second or so later and now it's updated. It works awesome.
GrandMasterTuck is offline   Reply With Quote
The Following User Says Thank You to GrandMasterTuck For This Useful Post:
hassanogaibi (06-28-2016)
Old 06-20-2017, 11:53 AM   #9
freidaf
Newly Registered User
 
Join Date: Aug 2012
Posts: 33
Thanks: 14
Thanked 0 Times in 0 Posts
freidaf is on a distinguished road
Re: Front End Auto-Update

I have a question about the 6-9-2014 post by Frothingslosh. Where would I place the CheckFrontEnd() function for this to run when a user opens the database?

Thank you
freidaf is offline   Reply With Quote
Old 10-18-2017, 01:17 AM   #10
hinchi1
Newly Registered User
 
Join Date: Oct 2017
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
hinchi1 is on a distinguished road
Re: Front End Auto-Update

Hello

i know this is an old thread but i am new to this forum. I am trying to get the FE update to work by "Frothingslosh" but when i run it the message i get is "Cannot find master file", something like that anyway. I understand how to create tables and fields, but unsure how to have a table in the FE that is not linked to the the BE. and also what data needs to go in to the three tables. A simplified example would be great if at all possible.
hinchi1 is offline   Reply With Quote
Old 02-09-2018, 08:37 PM   #11
zfar
Newly Registered User
 
Join Date: Aug 2017
Posts: 9
Thanks: 2
Thanked 0 Times in 0 Posts
zfar is on a distinguished road
Re: Front End Auto-Update

Great bit of code.

Since my users will she the front end in a variety of places on their PC, is there a way to grab the current path of the outdated front end before closing it, and then inserting that path into the copy statement, so that the new front end is chipped to the same location the user choose to put his original front end?

Cheers

Zane
zfar is offline   Reply With Quote
Old 05-24-2018, 07:02 AM   #12
jaryszek
Newly Registered User
 
Join Date: Aug 2016
Posts: 282
Thanks: 93
Thanked 0 Times in 0 Posts
jaryszek is on a distinguished road
Re: Front End Auto-Update

Hi Guys,

sorry for redigging old topic, but i have to ask

Quote:
which is by default installed on the user's PC along with the application itself.
what does it mean? What mechanism are you using?

Best,
Jacek
jaryszek is offline   Reply With Quote
Old 06-10-2018, 07:33 AM   #13
ridders
Part time moderator
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 6,189
Thanks: 83
Thanked 1,530 Times in 1,426 Posts
ridders is just really nice ridders is just really nice ridders is just really nice ridders is just really nice ridders is just really nice
Re: Front End Auto-Update

I have just approved 8 posts in this thread, some of which had been buried for over 2 years. Posting to trigger email notifications
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

New example databases:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

-----------------------------------------------------------------------------------
nil illegitimi carborundum est
ridders is offline   Reply With Quote
Old 06-12-2018, 04:26 PM   #14
Frothingslosh
Premier Pale Stale Ale
 
Frothingslosh's Avatar
 
Join Date: Oct 2012
Location: Flint, Michigan, USA
Posts: 2,879
Thanks: 71
Thanked 402 Times in 363 Posts
Frothingslosh will become famous soon enough Frothingslosh will become famous soon enough
Re: Front End Auto-Update

Oh, dear, so many responses all at once.

Quote:
Originally Posted by papan36125 View Post
Hello,

I have a question. i am currently building a multi user Access application at work. You code is perfect for that. Can I use this as part of a Business Application?

Regards,

Arka
This was posted for anyone to use, so feel free. I would ask that anyone using this credit Bob Larson in the notes.

Quote:
Originally Posted by princeade View Post
Hello Frothingslosh:
I added your code in a module and compile it. There is a

"COMPILE ERROR" - Sub or function not defined.

Kindly upload a small sample of your version checker (any version up to Access 2013 can be uploaded here).

I'm the second person requesting your sample due to error. Another person (Sean75db) who posted earlier in the thread also asked for a sample. It will be appreciated if you would upload a small sample. Thank you.
I don't use this where I work - we use batch files to force a download every time the user starts the app instead - but this code was literally cut and pasted from a working database I had on my previous PC.

As to 'UpdateFrontEnd' not being defined in my module, I don't see how that is remotely possible, seeing as it's the name of the procedure in the second code window. If you try to compile and you're told there's no UpdateFrontEnd, please come back to this post and grab BOTH procedures, not just the first one.

Quote:
Originally Posted by GBalcom View Post
Has this been proven with MS Access Runtime on the Front Ends?
Yes

Quote:
Originally Posted by freidaf View Post
I have a question about the 6-9-2014 post by Frothingslosh. Where would I place the CheckFrontEnd() function for this to run when a user opens the database?

Thank you
Make a startup procedure that is called via the macro AutoExec. Make this the first thing that procedure does.

Quote:
Originally Posted by hinchi1 View Post
Hello

i know this is an old thread but i am new to this forum. I am trying to get the FE update to work by "Frothingslosh" but when i run it the message i get is "Cannot find master file", something like that anyway. I understand how to create tables and fields, but unsure how to have a table in the FE that is not linked to the the BE. and also what data needs to go in to the three tables. A simplified example would be great if at all possible.
tbl-fe_version must be included in the front end. It contains the field fe_version_number, which is the version number for the front end.

tbl-version_fe_master is saved in the same location as the master copy but in a separate database (the name doesn't really matter), and you link it to the front end. It ALSO has a field fe_version_number, and it contains whatever the current MASTER version number is.

Finally, there is a table tbl-version_master_location. It can be in the same database as the master version number (that's where I'd put it), or it can be in the regular backend. Either way, it must ALSO be linked to the front end. The table contains the field s_masterlocation, which simply stores the full path (but not the name) for the master front end location.

Those are really all that's needed to make this work, but FOR THE LOVE OF GOD, when you update a new front end version, make sure to match the front end version with the master version or your users will wind up in an infinite update loop.

Quote:
Originally Posted by zfar View Post
Great bit of code.

Since my users will she the front end in a variety of places on their PC, is there a way to grab the current path of the outdated front end before closing it, and then inserting that path into the copy statement, so that the new front end is chipped to the same location the user choose to put his original front end?

Cheers

Zane
It already does this.

Quote:
Originally Posted by jaryszek View Post
Hi Guys,

sorry for redigging old topic, but i have to ask



what does it mean? What mechanism are you using?

Best,
Jacek
I think Tuck was just saying that he installs MyUpdater.accde (which just autoruns the code he provided) at the same time and into the same directory as whatever application he is installing.
__________________
This is a test.
This is only a test.
If this were a real emergency, you would NOT have been informed, and we would have fled screaming in terror.

Last edited by Frothingslosh; 06-13-2018 at 04:29 AM.
Frothingslosh is offline   Reply With Quote
Old 07-02-2018, 12:16 PM   #15
psyc0tic1
Access Moron
 
Join Date: Jul 2017
Posts: 263
Thanks: 134
Thanked 2 Times in 2 Posts
psyc0tic1 is on a distinguished road
Re: Front End Auto-Update

Quote:
Originally Posted by Frothingslosh View Post
We've seen a number of requests lately about automatically distributing database front end files after a new version is released. This is a modified version of code taken elsewhere on the web; I did not write the vast majority of it, only making a couple updates (mainly to keep the code from deleting the front-end if the file is run with no network connection).
Frothingslosh,

I have implemented this code in my database it works well other than one little snag.

I notice that it leaves a batch file on my desktop (where I have my front end app located) after I open it up and let it do the update thing.

The bad part is I just happened to click on it while my front end was open and it tried to do the delete/download etc process again and that rendered the front end useless and no longer functioned.

do you know of a way to make that code clean up after itself?

I put your code in a module and called it from my login form to check before anyone can login since there are different security levels and to not have to put code in every home screen.

Thank you very much in advance.

__________________
Richard
Access 2013, Windows 7 64 bit
psyc0tic1 is offline   Reply With Quote
Reply

Tags
update front end , vba

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Update Front End basshead22 Forms 1 01-31-2014 12:11 PM
Auto Update front end error! johnyjassi Forms 3 08-02-2012 02:39 PM
Front end auto update - please advice! paulsteigel Theory and practice of database design 2 11-08-2010 07:54 AM
Auto-Update Front End Question MrsGorilla General 9 01-13-2010 11:14 PM
Front-end Auto-Update Utility Henley12 General 9 12-21-2009 01:18 PM




All times are GMT -8. The time now is 05:26 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World