Results 1 to 9 of 9
  1. #1
    New Lounger
    Join Date
    Sep 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Save changes (2000)

    Hello,

    I have a bit of code where I scroll through the detail recordset and try to set something based on a value in the Master. However, I can't make the changes stick. The problem seems to be that I don't know the command for saving changes.

    [Broken Code]
    Dim State As Boolean
    Dim tdf As Object
    Dim rstSubReg As Object
    Dim dbs As Object

    ...State = Paid.Value
    ...Set dbs = CurrentDb

    ...Set tdf = dbs.TableDefs("SubRegistrations")
    ...Set rstSubReg = tdf.OpenRecordSet

    ...Do
    ......rstSubReg.Edit
    ......rstSubReg!Paid = State
    ......rstSubReg.Save
    ......rstSubReg.MoveNext
    ...Loop While Not (rstSubReg.EOF)
    [/Broken Code]

    I also tried the command "Post" but the interpreter doesn't recognize either one as valid. If I leave out that line, the program runs, but doesn't save my changes. What simple thing am I missing?

    Thank you,
    Frank

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Save changes (2000)

    Change the command

    ......rstSubReg.Save

    to

    ......rstSubReg.Update

    HTH
    Pat <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  3. #3
    New Lounger
    Join Date
    Sep 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save changes (2000)

    Thank you! This project is now very close to completion! <img src=/S/bananas.gif border=0 alt=bananas width=33 height=35>

    I knew it was something simple. The reason I can't use the helpfiles to find my questions is that the computer management center at my workplace decided that I didn't need the full Access helpfiles and didn't install them. So I now have all the information I need except what I really need. <img src=/S/yep.gif border=0 alt=yep width=15 height=15>

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Save changes (2000)

    Just one thing about your code (second thoughts, aren't they wonderful).
    I would put the condition on the Do command and not the Loop command, just in case there are no records in the recordset.
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Save changes (2000)

    Not having the helpfiles isn't all bad - at least you don't end up frustrated because you spent hours looking for the answer and can't find it. Wait till you get to XP help files!
    Wendell

  6. #6
    New Lounger
    Join Date
    Sep 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save changes (2000)

    Yeah, but they installed all the indexes, so I type in a search and see all the entries related to the commands I am trying to decipher. So I know the information I need exists and should be at my fingertips, but the entries don't appear when I click or double-click the index names. I sometimes get a message that the helpfiles were not installed properly or it just leaves the last item displayed. <img src=/S/sigh.gif border=0 alt=sigh width=15 height=15> And the helpless desk is living up to its misnomer.

    Frank Luke

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Save changes (2000)

    That means the help isn't completely installed. There are a couple of files you need to copy to other folders in order to magically get those topics you're seeing. I went through this with both ADO and DAO help in 2000. I wish I could find the thread that gave me the answer to which files and where, but it involved copying a couple of chm files to another location. <img src=/S/newbrain.gif border=0 alt=newbrain width=21 height=22> Maybe someone else can recall.
    Charlotte

  8. #8
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Save changes (2000)

    Charlotte, Was it this one? <post#=136442>post 136442</post#>
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  9. #9
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Save changes (2000)

    I do believe that's the one, Steve! Thanks. <img src=/S/bow.gif border=0 alt=bow width=15 height=15>
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •