troubleshooting Question

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

Avatar of Jeffrey Davidson
Jeffrey Davidson asked on
HTMLVBAMicrosoft Access
2 Comments1 Solution25 ViewsLast Modified:
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?
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros