Re: Code help (ADDITIONAL)
From: pokdbz (pokdbz_at_discussions.microsoft.com)
Date: 12/15/04
- Next message: Tim Marshall: "Re: ODBC Connection"
- Previous message: Ken Snell [MVP]: "Re: Help with VB statement"
- In reply to: Rick Brandt: "Re: Code help (ADDITIONAL)"
- Next in thread: Rick Brandt: "Re: Code help (ADDITIONAL)"
- Reply: Rick Brandt: "Re: Code help (ADDITIONAL)"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 15 Dec 2004 12:05:04 -0800
Thanks for the help.
What does dirty do anyway I am confused about this term and what it does?
Also what is the difference between commit and rollback
"Rick Brandt" wrote:
> You are also never committing your transaction so your queries are doing
> nothing. Whenever you have a BeginTransaction somewhere later you need
> either a Rollback or a Commit.
>
> "Rick Brandt" <rickbrandt2@hotmail.com> wrote in message
> news:32bgm1F3kltlhU1@individual.net...
> > "pokdbz" <pokdbz@discussions.microsoft.com> wrote in message
> > news:D415E26A-E4F9-4E66-88ED-F3033047B9B5@microsoft.com...
> > > I have this piece of code below and when I run it it says that
> SaveRecord
> > is
> > > not available. Does anyone have a clue why.
> > >
> > >
> > > Private Sub cmdSave_Click()
> > > On Error GoTo Err_cmdSave_Click
> > >
> > > save = True
> > >
> > > Dim sessionDate As Date
> > >
> > > Dim qdfDone As DAO.QueryDef
> > > Dim qdfStudyIdSSN As DAO.QueryDef
> > > Dim qdfNextDate As DAO.QueryDef
> > > Dim qdfRemindDate As DAO.QueryDef
> > >
> > > 'If Check1 = "Yes" Then
> > > 'Since we are adding to two tables, lets make it a transaction
> > > DBEngine.BeginTrans
> > >
> > > Set qdfDone = CurrentDb.QueryDefs("QueryAddDoneSession")
> > > qdfDone.Parameters("newId") = InterviewID
> > > qdfDone.Parameters("newVisit") = 1
> > > qdfDone.Execute
> > >
> > >
> > > Set qdfNextDate = CurrentDb.QueryDefs("QueryAddStatusNextDate")
> > > qdfNextDate.Parameters("newId") = InterviewID
> > > qdfNextDate.Parameters("newVisit") = 2 'schedule next
> interview
> > > qdfNextDate.Parameters("newInterviewDate") = sessionDate + 350
> > > qdfNextDate.Execute
> > >
> > > qdfNextDate.Close
> > >
> > > Set qdfRemindDate =
> > > CurrentDb.QueryDefs("QueryAddStatusReminderDate")
> > > qdfRemindDate.Parameters("newId") = InterviewID
> > > qdfRemindDate.Parameters("newVisit") = 1
> > > qdfRemindDate.Parameters("newCallDate") = sessionDate + 290
> > > qdfRemindDate.Execute
> > >
> > > qdfRemindDate.Close
> > >
> > >
> > >
> > > DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
> > acMenuVer70
> > > save = False
> > > Call InterviewSession.CloseSession
> > > 'End If
> > >
> > > Form.Requery
> > >
> > > Exit_cmdSave_Click:
> > > Exit Sub
> > >
> > > Err_cmdSave_Click:
> > > MsgBox Err.Description
> > > Resume Exit_cmdSave_Click
> > >
> > > End Sub
> >
> > If the form that this code is running behind hasn't been "dirtied" then
> > there is nothing to save. Whatever changes you are processing with your
> > queries have nothing to do with the record currently on the form.
> >
> > --
> > I don't check the Email account attached
> > to this message. Send instead to...
> > RBrandt at Hunter dot com
> >
> >
>
>
>
- Next message: Tim Marshall: "Re: ODBC Connection"
- Previous message: Ken Snell [MVP]: "Re: Help with VB statement"
- In reply to: Rick Brandt: "Re: Code help (ADDITIONAL)"
- Next in thread: Rick Brandt: "Re: Code help (ADDITIONAL)"
- Reply: Rick Brandt: "Re: Code help (ADDITIONAL)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|