Hi All,
Im sort of new to VBA but need some help.
What I would like to do is loop through a table and grab the results and populate them into my text string like
Available in the Following Colours:
White
Mist Grey
Ivory
Peach
In my code, I link to a colour table and grab the colour and link this with my product description table and then wrap it in html tags. Then I save this using the open file.
Then I can view this html file in a broswer window on my form the check the html code.
**** but when I do the loop it goes straight to the last one!, and misses out the first 3 colurs.
Can anyone point me in the right direct PLEASE!!!!!
-----------------------------------
Dim strColour As string
Dim mydb2 As ADODB.Recordset
Dim intFile As Integer
Set mydb2 = New ADODB.Recordset
intFile = FreeFile
mydb2.ActiveConnection = CurrentProject.Connection
mydb2.Open "select Colour_Text from Colours where proddesc_id =" & Me.PRODDESCID
While Not mydb2.EOF
strColour = mydb2.Fields("colour_text"
Me.html_text = "<font face='Verdana' size='2'><b>" & Me.SHORTTEXT & "</b></font>" _
& "<font face='Verdana' size='2'>" & "<p>" _
& "<b>Features</b><hr>" _
& "<b>::</b> " & strFeatures & "</b>" _
& "<p>" & Me.PRODDESCR _
& "<p><i>Available in the Following Colours:</i><p>" _
& "<b>::</b> " & strColour _ '*** See here I need this to show all colours!!!
& "</font>"
Open "E:\SBT\Supplier_Information\Website Connection\html\test.html" For Output As intFile
Print #intFile, _
Me.html_text
Close intFile
mydb2.MoveNext
Wend
mydb2.Close
Set mydb2 = Nothing
Me.WebBrowser1.Navigate "E:\SBT\Supplier_Information\Website Connection\html\test.html"
-------
thanks
brendan
Im sort of new to VBA but need some help.
What I would like to do is loop through a table and grab the results and populate them into my text string like
Available in the Following Colours:
White
Mist Grey
Ivory
Peach
In my code, I link to a colour table and grab the colour and link this with my product description table and then wrap it in html tags. Then I save this using the open file.
Then I can view this html file in a broswer window on my form the check the html code.
**** but when I do the loop it goes straight to the last one!, and misses out the first 3 colurs.
Can anyone point me in the right direct PLEASE!!!!!
-----------------------------------
Dim strColour As string
Dim mydb2 As ADODB.Recordset
Dim intFile As Integer
Set mydb2 = New ADODB.Recordset
intFile = FreeFile
mydb2.ActiveConnection = CurrentProject.Connection
mydb2.Open "select Colour_Text from Colours where proddesc_id =" & Me.PRODDESCID
While Not mydb2.EOF
strColour = mydb2.Fields("colour_text"
Me.html_text = "<font face='Verdana' size='2'><b>" & Me.SHORTTEXT & "</b></font>" _
& "<font face='Verdana' size='2'>" & "<p>" _
& "<b>Features</b><hr>" _
& "<b>::</b> " & strFeatures & "</b>" _
& "<p>" & Me.PRODDESCR _
& "<p><i>Available in the Following Colours:</i><p>" _
& "<b>::</b> " & strColour _ '*** See here I need this to show all colours!!!
& "</font>"
Open "E:\SBT\Supplier_Information\Website Connection\html\test.html" For Output As intFile
Print #intFile, _
Me.html_text
Close intFile
mydb2.MoveNext
Wend
mydb2.Close
Set mydb2 = Nothing
Me.WebBrowser1.Navigate "E:\SBT\Supplier_Information\Website Connection\html\test.html"
-------
thanks
brendan