R
Robert Batt
Hello,
I have the following code that highlights a
particular active record in a continuous form when the
form is loaded using the gotorecord command. This
procedure works fine in an adp but when the ade is built
it seems to ignore this code and just highlights the top
record each time. why does it do this and how can I get
this code to work.
Regards
David
Private Sub HighlightActiveBusiness()
' rds uk-jdet-5lvf8l 18/12/2003 - highlight the
current active business
Dim sql As String
Dim Conn As New ADODB.Connection
Dim rst1 As New ADODB.Recordset
Dim IntActiveBusinessId As Integer
Dim IntCurrentId As Integer
IntCurrentId = Forms![frmBusinessDetails]!
[BusinessDetailsKey]
sql = "SPSchedSelectActiveBusiness"
Set Conn = Application.CurrentProject.Connection
Set rst1 = New ADODB.Recordset
Conn.CommandTimeout = 0
rst1.Open sql, Conn, adOpenDynamic, adLockOptimistic,
adCmdStoredProc
If (Not (rst1.EOF)) Then
IntActiveBusinessId = rst1!BusinessID
End If
While IntCurrentId <> IntActiveBusinessId
DoCmd.GoToRecord , , acNext
IntCurrentId = Forms![frmBusinessDetails]!
[BusinessDetailsKey]
Wend
Set rst1 = Nothing
Set Conn = Nothing
End Sub
I have the following code that highlights a
particular active record in a continuous form when the
form is loaded using the gotorecord command. This
procedure works fine in an adp but when the ade is built
it seems to ignore this code and just highlights the top
record each time. why does it do this and how can I get
this code to work.
Regards
David
Private Sub HighlightActiveBusiness()
' rds uk-jdet-5lvf8l 18/12/2003 - highlight the
current active business
Dim sql As String
Dim Conn As New ADODB.Connection
Dim rst1 As New ADODB.Recordset
Dim IntActiveBusinessId As Integer
Dim IntCurrentId As Integer
IntCurrentId = Forms![frmBusinessDetails]!
[BusinessDetailsKey]
sql = "SPSchedSelectActiveBusiness"
Set Conn = Application.CurrentProject.Connection
Set rst1 = New ADODB.Recordset
Conn.CommandTimeout = 0
rst1.Open sql, Conn, adOpenDynamic, adLockOptimistic,
adCmdStoredProc
If (Not (rst1.EOF)) Then
IntActiveBusinessId = rst1!BusinessID
End If
While IntCurrentId <> IntActiveBusinessId
DoCmd.GoToRecord , , acNext
IntCurrentId = Forms![frmBusinessDetails]!
[BusinessDetailsKey]
Wend
Set rst1 = Nothing
Set Conn = Nothing
End Sub