ok i have a on load code:
Now in this part i get the update message from a table:
i want the update message to be (I have this on my table):
how can i make it so it can read the code instead of making it a string? This way if i want to change it i can change it from the back end and it will not require a code change.
Code:
Private Sub Form_Load()
Dim db As DAO.Database
Dim rsv As DAO.Recordset
Dim rsmv As DAO.Recordset
Dim CurVer As String
Dim MasVer As String
Dim rs1 As DAO.Recordset
Dim Version As String
Dim Updatemsg As String
Dim rsupdatemsg As DAO.Recordset
Set db = CurrentDb
Set rsv = db.OpenRecordset("Version", dbOpenDynaset)
Set rsmv = db.OpenRecordset("MasterVersion", dbOpenDynaset)
Set rsupdatemsg = db.OpenRecordset("Updatemsg", dbOpenDynaset)
On Error GoTo ErrorRPT
With rsv
.MoveFirst
CurVer = .Fields("Version")
End With
rsv.Close
With rsmv
.MoveFirst
MasVer = .Fields("MasterVersion")
End With
rsmv.Close
With rsupdatemsg
.MoveFirst
Updatemsg = .Fields("Updatemsg")
End With
rsupdatemsg.Close
If MasVer = CurVer Then
DoCmd.OpenForm "infokeeper", , , , acFormAdd, acHidden
Else
MsgBox Updatemsg, vbExclamation & vbOKOnly, "Update Available"
Call Shell("C:\Program Files\SAI Inventory\SAI inventory Updating tool.bat", vbMaximizedFocus)
End If
Set rs1 = db.OpenRecordset("Version", dbOpenDynaset)
With rs1
.MoveFirst
Version = .Fields("Version")
End With
rs1.Close
Me.Version = "Version " & Version
GoTo Endsubtxt
ErrorRPT:
Call ErrorRPT1
Endsubtxt:
End Sub
Now in this part i get the update message from a table:
Code:
With rsupdatemsg
.MoveFirst
Updatemsg = .Fields("Updatemsg")
End With
rsupdatemsg.Close
If MasVer = CurVer Then
DoCmd.OpenForm "infokeeper", , , , acFormAdd, acHidden
Else
MsgBox Updatemsg, vbExclamation & vbOKOnly, "Update Available"
Call Shell("C:\Program Files\SAI Inventory\SAI inventory Updating tool.bat", vbMaximizedFocus)
End If
i want the update message to be (I have this on my table):
Code:
"You are currently running version " & CurVer & ". There is a updated version available " & MasVer & ". Please wait for the program to close and update, it will automatically re-open after the update."
how can i make it so it can read the code instead of making it a string? This way if i want to change it i can change it from the back end and it will not require a code change.