policechiefwiggum
Programmer
Hi All,
I've got a bit of code that works well for the 1st part of a process but i'm not sure how to "undo" the change it makes for the 2nd part.
I have this code: (note - i can't spell and "ProjectTitile" is the correct name for the form field!!)
The above code works perfectly by adding "(On Hold)" when a project is placed On hold, however what i want to do is remove just the "on Hold" part of the project title when the project is either opened or closed.
I've been told i can do this using the Replace or Substitue command but i have no idea how to use this command, i've had a bash with this
I'm not sure if this is doing anything, and even if it is i cant see how it wouild work because i've not got any code to update the database with the new project name!!
Thanks
for your help as always
I've got a bit of code that works well for the 1st part of a process but i'm not sure how to "undo" the change it makes for the 2nd part.
I have this code: (note - i can't spell and "ProjectTitile" is the correct name for the form field!!)
Code:
If Me.proj_status.Value = "On Hold" Then
Me.ProjectTitile.Value = Me.ProjectTitile.Value & " (On Hold)"
Me.Form.Caption = "Updating Project ID '" & Me.uatproject.Value & "' Project Name '" & Me.ProjectTitile.Value & "'"
Dim UATProjectSTR As String
UATProjectSTR = Me.uatproject.Value
Dim UpdateProjectSQL As String
Set ConnectDatabase = CurrentProject.Connection
Set DatabaseSQL = New ADODB.Command
UpdateProjectSQL = "UPDATE [projects] SET [ProjectTitle] = '" & Me.ProjectTitile.Value & "' WHERE [UATID] = " & UATProjectSTR
DatabaseSQL.ActiveConnection = ConnectDatabase
DatabaseSQL.CommandText = UpdateProjectSQL
DatabaseSQL.Execute
MsgBox ("Project " & ProjName & " has been placed on Hold.")
The above code works perfectly by adding "(On Hold)" when a project is placed On hold, however what i want to do is remove just the "on Hold" part of the project title when the project is either opened or closed.
I've been told i can do this using the Replace or Substitue command but i have no idea how to use this command, i've had a bash with this
Code:
Replace Me.proj_status.Value, " (On Hold)", ""
Thanks
for your help as always