Originally Posted by
MayaMia
...Now, when I use the form to
enter a new record, the reports do not populate with any data from the new record...
...it's like
new records entered are not pulling through to the reports...
Code:
Private Sub VocSurvey_Click()
On Error GoTo Err_VocSurvey_Click
Dim strDocName As String
Dim strWhere As String
strDocName = "Vocational Survey"
strWhere = "[ClaimNumber]='" & Me!ClaimNumber & "'"
DoCmd.OpenReport strDocName, acNormal, , strWhere
Exit_VocSurvey_Click:
Exit Sub
Err_VocSurvey_Click:
MsgBox Err.Description
Resume Exit_VocSurvey_Click
End Sub
That's because the 'New Record' doesn't exist! At the point in time where you're clicking on the VocSurvey ('print') button, the Record has not been Saved/Committed! In your code, just below your Dim Statements, add the line in Red and see what happens:
Code:
Private Sub VocSurvey_Click()
On Error GoTo Err_VocSurvey_Click
Dim strDocName As String
Dim strWhere As String
DoCmd.RunCommand acCmdSaveRecord
strDocName = "Vocational Survey"
strWhere = "[ClaimNumber]='" & Me!ClaimNumber & "'"
DoCmd.OpenReport strDocName, acNormal, , strWhere
Exit_VocSurvey_Click:
Exit Sub
Err_VocSurvey_Click:
MsgBox Err.Description
Resume Exit_VocSurvey_Click
End Sub
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007