Avatar of Jeffrey Davidson
Jeffrey Davidson

asked on 

How would I insert the value or a variable into html code.

One of my access 2016 programs uses html code to help the users of the program to navigate to the next step. I'll post a picture and that will make it a little easier to explain what I'm trying to accomplish.
The fragment of code I used looks like this:

Dim Project As Variant
Project = Forms!frmTasks![lblAssignment_Number].Caption
Dim Request As Variant
Request = Forms!frmTasks![lblTaskProjItNumber].Caption
        'frmTasks 1st fill of:: Forms!frmTasks![txtTask_Instructions].value = StepsTaken
        StepsTaken = ""
        StepsTaken = StepsTaken & "<div><font color=black>Steps Taken:</font></div>"
        StepsTaken = StepsTaken & "<div><font color=black>&nbsp;</font></div>"
        StepsTaken = StepsTaken & "<div><font color=black>1. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You have chosen to add the current project request to</font></div>"
        StepsTaken = StepsTaken & "<div><font color=black>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color=red>${Project}</font><font color=black> as Request # </font><font color=red>${Request}.</font></div>"
        StepsTaken = StepsTaken & "<div><font color=black>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1a. &nbsp;&nbsp;&nbsp;&nbsp;</font><font color=red>&nbsp;Analytical Lab Selected.</font></div>"
        StepsTaken = StepsTaken & "<div><font color=black>2. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color=red>Add Additional information for this task as necessary.</font></div>"
        StepsTaken = StepsTaken & "<div><font color=red>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Click &quot;Skip This Step / Next&quot; when completed</font></div>"
        'Debug.Print StepsTaken
        Forms!frmTasks![txtTask_Instructions].value = StepsTaken
        Forms!frmTasks![txtAdditionalTaskInfo].BorderColor = RGB(237, 28, 36)                          'Dark Red
        Forms!frmTasks![txtAdditionalTaskInfo].Enabled = True
        Forms!frmTasks![cboAssigned_Res].BorderColor = RGB(211, 211, 211)                              'Grey
        Forms!frmTasks![cmdCurrProjRes].BorderColor = RGB(211, 211, 211)                               'Grey
        Forms!frmTasks![lstCurrentResources].BorderColor = RGB(211, 211, 211)                          'Grey
        Forms!frmTasks![cmdRemoveResourceProject].BorderColor = RGB(211, 211, 211)                     'Grey
        modStatusBar.StatusBar ("")
End Sub
Public Sub RemoveAssigned(Counter As Integer, Old_Person As String)
'The number of assigned persons has decreased; remove on an individual basis
On Error Resume Next
Dim SQL As String
Dim Person_Number As Integer

Person_Number = modTaskAssignment.ReturnEmployeeID(Old_Person)

SQL = "Delete tblAssignedPerson_Link.APL_Link_Counter, tblAssignedPerson_Link.APL_Link_Person"
SQL = SQL & " From tblAssignedPerson_Link"
SQL = SQL & " WHERE (((tblAssignedPerson_Link.APL_Link_Counter)=" & Counter & ") AND ((tblAssignedPerson_Link.APL_Link_Person)=" & Person_Number & "));"

Open in new window

I have tried a few other things I could find but nothing seeded to work for me.
Do any one have any ideas on how to make this work?
HTMLVBAMicrosoft Access

Avatar of undefined
Last Comment
Ryan Chong

8/22/2022 - Mon