I am trying to set some variables in VBA so that I can add them to a URL for a Active X control. However, the debugger keeps telling me that "an object is required". I don't understand what it wants. If someone could help me, I would really appreciate it. Here is the code I am trying to use:
It doesn't seem to like my first two Set statements. Those are what it highlights.
I know the field names are very generic, that is because I was just trying to test this and have not assigned meaningful names yet. Text1 and Text4 are just a couple of text boxes and WebBrowser0 is my ActiveX control. I thought I would see if I could get it to work before I renamed anything.
Code:
Dim strURL As String
Dim HTML As Object
Dim AirportCode As String
Dim WeatherDate As String
Set AirportCode = Me.Text1
Set WeatherDate = Me.Text4
Set strURL = "[URL]http://www.wunderground.com/history/airport/[/URL]" & AirportCode & WeatherDate & "CustomHistory.html"
Set HTML = Me.WebBrowser0.Object
HTML.navigate strURL
It doesn't seem to like my first two Set statements. Those are what it highlights.
I know the field names are very generic, that is because I was just trying to test this and have not assigned meaningful names yet. Text1 and Text4 are just a couple of text boxes and WebBrowser0 is my ActiveX control. I thought I would see if I could get it to work before I renamed anything.