Re: Code help (ADDITIONAL)
From: Rick Brandt (rickbrandt2_at_hotmail.com)
Date: 12/15/04
- Next message: Rob Oldfield: "Re: ODBC Connection"
- Previous message: Rick Brandt: "Re: Code help"
- In reply to: Rick Brandt: "Re: Code help"
- Next in thread: pokdbz: "Re: Code help (ADDITIONAL)"
- Reply: pokdbz: "Re: Code help (ADDITIONAL)"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 15 Dec 2004 13:15:15 -0600
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: Rob Oldfield: "Re: ODBC Connection"
- Previous message: Rick Brandt: "Re: Code help"
- In reply to: Rick Brandt: "Re: Code help"
- Next in thread: pokdbz: "Re: Code help (ADDITIONAL)"
- Reply: pokdbz: "Re: Code help (ADDITIONAL)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|