Hi
---Reason behind this is to open a different DB and Update the original 1 using filecopy---
I used this code last night, it seemed to work fine, However, today at work its not doing anything?
I therefore tried this, thinking it might do the job.. Still nothing!!!
Could there be a reference missing in VB code area?
Is there something wrong with my code??
Hope you can help
Plz
Thx, Darin
---Reason behind this is to open a different DB and Update the original 1 using filecopy---
I used this code last night, it seemed to work fine, However, today at work its not doing anything?
Code:
Dim appAccess As New Access.Application
appAccess.OpenCurrentDatabase ("C:\Lynx\Test1.mde")
'--This command CLOSES the DATABASE---
DoCmd.Quit
I therefore tried this, thinking it might do the job.. Still nothing!!!
Could there be a reference missing in VB code area?
Is there something wrong with my code??
Code:
Private Sub cmdUpdateDB_Click()
Dim VarPassword As Variant
'Dim appAccess As New Access.Application
VarPassword = DLookup("[UpdateDatabase]", "tblPassword", "[PasswordID] = [Forms]![frmSwitchboard]![tPassID]")
Dim appAccess As Access.Application
Dim strDB As String
' Initialize string to database path.
Const strConPathToSamples = "C:\Lynx\"
strDB = strConPathToSamples & "LynxFormsServerUPDATE.mdb"
' Create new instance of Microsoft Access.
Set appAccess = _
CreateObject("Access.Application")
' Open database in Microsoft Access window.
If VarPassword = 0 Then
'message box
MsgBox "This form is restricted to Database Administrator"
Else
Select Case Me.cmdUpdateDB.Caption
Case "NO Update available"
MsgBox "No Update at this time"
Case "DATABASE UPDATE AVAILABLE"
MsgBox "Going to Update the database now"
appAccess.OpenCurrentDatabase strDB
'--This command CLOSES the DATABASE---
DoCmd.Quit
End Select
End If
End Sub
Hope you can help
Plz
Thx, Darin