Re: Code help (ADDITIONAL)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Rick Brandt (rickbrandt2_at_hotmail.com)
Date: 12/15/04


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
>
>



Relevant Pages

  • RE: External data import
    ... 'Purpose of this VBA program is to find and list all Queries ... Dim i As Integer ... Dim strQueryParameters As String ... Dim strRangeName As String ...
    (microsoft.public.excel.misc)
  • Re: Code to list Objects in DB lists deleted SQL
    ... Tom (that they're temporary queries). ... lists the queries it lists some which look like they are the statements ... Dim MyQueries() As String ...
    (microsoft.public.access.formscoding)
  • Re: Export Excel To Access Wizard HELP!!!
    ... Depending on what your Excel code is doing and what's in your queries, ... The sample procedure below opens a secured mdb and will work with minor ... Dim dbW 'As DAO.Workspace 'to change from late to ...
    (microsoft.public.access.externaldata)
  • Re: Another Access Scripting Question
    ... A wrinkle I often use when writing anything but the simplest VBScript is ... Dim App 'As Access.Application ... The database I built with all the queries works, ...
    (microsoft.public.access.modulesdaovba)
  • RE: Dynamically referencing a recordset?
    ... Dim rst As DAO.Recordset ... Are there any Domain Aggragate Functions in your queries? ... Next RecTypeCounter ... which record type is being currently measured. ...
    (microsoft.public.access.modulesdaovba)