Update table with a macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I have a form that is used to enter specific electrical readings on
pumps. I have placed a button on my form to open a report to show these
readings for a specific pump based on which pump has been selected in the
combo box on my form. The idea behind this is so that the user can enter new
information, then view that information along with previous information
without having to re-select the specific pump from a new form. The problem I
am having is that when the button is clicked and the report is opened, the
new data that has been entered isn't appearing on the report. I am looking
for a method to update the table, through a macro, with the new information
entered without having to close the form or having to start a new record.
Thanks in advance!
 
I was able to solve this problem I was having by using visual basic. Posting
for future reference.

Private Sub Command28_Click()
On Error GoTo Err_Command28_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim stDocName As String

stDocName = "RS_Maint_Amperages2"
DoCmd.OpenReport stDocName, acPreview

Exit_Command28_Click:
Exit Sub

Err_Command28_Click:
MsgBox Err.Description
Resume Exit_Command28_Click

End Sub
 
Rick,

Add a RunCommand/SaveRecord action to your macro, before the OpenReport
action.
 
Back
Top