RE: Event procedure does not execute without break point?????
- From: "Venus" <Venus@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 2 Aug 2005 13:16:11 -0700
Thanks so much for your time and effort but it works now.
The problem was that the previous item was not losing the focus.
Its wierd because when I click on the command button, it should
automatically set the focus to it. But when I did it explicitly by using
"set focus" in a macro, it started working.
Strange but it works!!
Thanks again.
"BruceM" wrote:
> In what way does it now work? Is there an error message? In the line:
> "where weekending = #" & [WeekEnding] & "# and recruiterid = " &
> [RecruiterID] & ";"
> how does weekending differ from [WeekEnding]? Same for RecruiterID.
> Are you trying to change many records or just the current one? Are you
> trying to accomplish through this code what could also be accomplished
> through an update query? It's fine if you are, but there are certain syntax
> rules you need to follow. If you can make this work through a query, post
> the query's SQL.
> I will need you to answer the questions in this post if I am to put any more
> time into this. My guesses about what you need to do have been wrong so far.
> If it is important to use DBEngine.Execute then you will need to start a new
> thread. I am not familiar with that command. However, be advised that
> whoever answers will probably ask as I have what you need to accomplish.
> Saying that you need to update the table pretty much describes any data entry
> or modification.
>
>
> "Venus" wrote:
>
> > It still doesn't work.
> > The DBEngine works too if I put a break-point in the code and step thru it.
> > Thats the confusing thing. If I step thru the code it executes, If I just
> > run it without putting any breaks points, nothing happens.
> >
> > "BruceM" wrote:
> >
> > > From your cryptic reply I gather you need to update all records that meet
> > > certain criteria. I will further assume that the SQL statement works in an
> > > update query, but not from a command button. Instead of DBEngine.Execute,
> > > try:
> > >
> > > Docmd.RunSQL strSql
> > >
> > > You may need to requery if you need immediate results on the current record.
> > >
> > > "Venus" wrote:
> > >
> > > > I need to update the employees table.
> > > >
> > > > "BruceM" wrote:
> > > >
> > > > > Is the idea to filter the recordset? If so, how about:
> > > > >
> > > > > On Error Goto ProcErr
> > > > >
> > > > > strsql = "UPDATE Employees INNER JOIN TimeSheets ON _
> > > > > Employees.EmployeeID = TimeSheets.EmployeeID SET _
> > > > > TimeSheets.RunComm = -1 " & "where weekending = #" & _
> > > > > [WeekEnding] & "# and recruiterid = " & [RecruiterID] & ";"
> > > > >
> > > > > Me.RecordSource = strSql
> > > > > Me.Requery
> > > > >
> > > > > ProcExit:
> > > > > Exit Sub
> > > > >
> > > > > ProcErr:
> > > > > msgbox "Error #" & Err.Number & ", " & Err.Description
> > > > > Resume ProcExit
> > > > >
> > > > > "Venus" wrote:
> > > > >
> > > > > > Private Sub SelectAllbtn_Click()
> > > > > > Dim strsql As String
> > > > > >
> > > > > > strsql = "UPDATE Employees INNER JOIN TimeSheets ON Employees.EmployeeID
> > > > > > = TimeSheets.EmployeeID SET TimeSheets.RunComm = -1 " & _
> > > > > > "where weekending = #" & [WeekEnding] & "# and recruiterid = " &
> > > > > > [RecruiterID] & ";"
> > > > > >
> > > > > > DBEngine(0)(0).Execute strsql, dbFailOnError
> > > > > >
> > > > > > End Sub
> > > > > >
> > > > > >
> > > > > > "BruceM" wrote:
> > > > > >
> > > > > > > What is the procedure?
> > > > > > >
> > > > > > > "Venus" wrote:
> > > > > > >
> > > > > > > > I have an event procedure on a command button.
> > > > > > > > The procedure does not execute unless I put a break point in the code.
> > > > > > > > It works when I step thru it, but if I remove the break point and click on
> > > > > > > > the button, nothing happens.
> > > > > > > > Any clues????
.
- References:
- Event procedure does not execute without break point?????
- From: Venus
- RE: Event procedure does not execute without break point?????
- From: BruceM
- RE: Event procedure does not execute without break point?????
- From: Venus
- RE: Event procedure does not execute without break point?????
- From: BruceM
- RE: Event procedure does not execute without break point?????
- From: Venus
- RE: Event procedure does not execute without break point?????
- From: BruceM
- RE: Event procedure does not execute without break point?????
- From: Venus
- RE: Event procedure does not execute without break point?????
- From: BruceM
- Event procedure does not execute without break point?????
- Prev by Date: RE: enter parameter value message when opening form
- Next by Date: Getting an overwrite with imbedded table
- Previous by thread: RE: Event procedure does not execute without break point?????
- Next by thread: RE: disable text box via combo box
- Index(es):
Relevant Pages
|