Debugging a record in a continuous form using oncurrent event

J

Jack

Hi,
I have a search form. The form receives search parameters. On the search
output it gives records in a continuous form.(The search and the output is a
single form) Now I have added code in the oncurrent event of the form. I have
put a breakpoint on the new code. As soon as I am opening this form the form
is going in the debug mode. It does not allow me to put values in the search
paramter and get the required output records, go the current record and step
through the code. How does one step through code put in oncurrent event in a
scenario like this? Any help is appreciated. Thanks

I intend to step through the following code:

Dim myDB As Database
Dim myRS As Recordset
Dim strSql As String

strSql = "SELECT Count(*) AS RecordCount FROM dbo_PWOProject WHERE Prefix
= '" & Me.Prefix & "' AND Number = '" & Me.Number & "' AND Revision = '" &
Me.Revision & "' AND PriceRevision = '" & Me.PriceRevision & "' And InUseBy =
""IsNull"""

Set myDB = CurrentDb()
Set myRS = myDB.OpenRecordset(strSql, dbOpenDynaset)

numrows = myRS(0)
myRS.Close

If numrows < 1 Then
Me.QuoteStatus.Locked = True
Me.BFTStatus.Locked = True
Me.MarkedForDelete.Locked = True
End If
 
J

Jeff Boyce

Jack

I'm not following...

If you want to use a breakpoint to step through the code that fires after
you have entered search terms and told the form to do the search, wouldn't
you want the breakpoint in the code that runs when you tell the form to
search (e.g., a command button)?

What am I missing?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jack

Thanks Jeff. I could solve the problem by putting debug.print in the code and
check to see how the variable values are changing from immediate window. With
this approach I did not have to put the breakpoint.
 
J

Jan Baird

Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top