Hi,
I have this code below where it queries a table. What currently happens is If BOF then stop. But I need it to say Ok not records in this table let continue on to next statement.
like ....
If mydb.BOF = true then Exit Sub 'This just stops the routine.
What I would like to do is
If mydb.BOF = true then goto next routine 'Which is the colours see code below.
Code
--------------------
' this one is for Features
mydb.ActiveConnection = CurrentProject.Connection
mydb.Open "select Feature_Text from Features where proddesc_id =" & Me.PRODDESCID
If mydb.BOF = True Then Exit Sub ' **** Here I dont want it to exit sub but goto the next part below Colours
With mydb
If .RecordCount Then
.MoveFirst
Do Until mydb.EOF
strFeatures = strFeatures & "<b><br>::</b> " & mydb.Fields("Feature_Text")
mydb.MoveNext
Loop
' this one is for Colours
mydb2.ActiveConnection = CurrentProject.Connection
mydb2.Open "select Colour_Text from Colours where proddesc_id =" & Me.PRODDESCID
If mydb2.BOF = True Then Exit Sub
With mydb2
If .RecordCount Then
.MoveFirst
Do Until mydb2.EOF
strColour = strColour & "<br><b>:: </b>" & mydb2.Fields("colour_text")
mydb2.MoveNext
Loop
Appreciate any help
thanks
I have this code below where it queries a table. What currently happens is If BOF then stop. But I need it to say Ok not records in this table let continue on to next statement.
like ....
If mydb.BOF = true then Exit Sub 'This just stops the routine.
What I would like to do is
If mydb.BOF = true then goto next routine 'Which is the colours see code below.
Code
--------------------
' this one is for Features
mydb.ActiveConnection = CurrentProject.Connection
mydb.Open "select Feature_Text from Features where proddesc_id =" & Me.PRODDESCID
If mydb.BOF = True Then Exit Sub ' **** Here I dont want it to exit sub but goto the next part below Colours
With mydb
If .RecordCount Then
.MoveFirst
Do Until mydb.EOF
strFeatures = strFeatures & "<b><br>::</b> " & mydb.Fields("Feature_Text")
mydb.MoveNext
Loop
' this one is for Colours
mydb2.ActiveConnection = CurrentProject.Connection
mydb2.Open "select Colour_Text from Colours where proddesc_id =" & Me.PRODDESCID
If mydb2.BOF = True Then Exit Sub
With mydb2
If .RecordCount Then
.MoveFirst
Do Until mydb2.EOF
strColour = strColour & "<br><b>:: </b>" & mydb2.Fields("colour_text")
mydb2.MoveNext
Loop
Appreciate any help
thanks