Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264

    Question Unanswered: continuous form and calculation

    I have a continuous form and I would like to cycle through all of the records on the form and perform a calculation. The calcuation is in a routine and then sets the bound text box on the form to the result

    Code:
    	On Error Resume Next
    	Me.Recordset.MoveFirst
    	Do While Not Me.Recordset.EOF
    		recalculate
    		Me.Recordset.MoveNext
    	Loop
    The movenext line causes a problem. It warns that the record has been changed by another user and I have to click on save record in order to continue. Any ideas how to get around this?

    Thanks.

    Steve

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    You can 'automatically' click the button with:

    DoCmd.RunCommand acCmdSaveRecord

    It does the same thing as going to Records, Save Record. It should solve your problem.

  3. #3
    Join Date
    Aug 2004
    Location
    Cary, NC
    Posts
    264
    I liked that idea but it isn't working for me.

    Infact, the warning that I am trying to surpress is now coming up when DoCmd.RunCommand acCmdSaveRecord is executed. I have tried setting warnings to false but it isn't that kind of warning.

    Any other thoughts?


    Steve

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by sps
    I liked that idea but it isn't working for me.

    Infact, the warning that I am trying to surpress is now coming up when DoCmd.RunCommand acCmdSaveRecord is executed. I have tried setting warnings to false but it isn't that kind of warning.

    Any other thoughts?

    Hi sps,

    The line below is what is normally in the acSaveRecord code:

    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

    Try that and see what happens. Oh, I found a better way to avoid suppress warning messages. Rather than doing the (SetWarnings/True/False) thingy in my code I have:
    CurrentDB.Execute "My Special Query here"

    Hope this helps you out,
    have a nice one,
    Bud

Posting Permissions

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