Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Me.Refresh cunundrum

Status
Not open for further replies.

uscitizen

Technical User
Jan 17, 2003
672
US
Hi, the “Refresh” part of the “Me.Refresh” in the code immediately following is described as “Method or data member not found” in a “Compiler Error” message:

Private Sub Command41_Click()
On Error GoTo Err_Command41_Click

Dim stDocName As String

stDocName = "Concomitant Medications"

Me.Refresh

DoCmd.OpenReport stDocName, acNormal, "", "[Patient Number]= " & Me![Patient Number]

Exit_Command41_Click:
Exit Sub

Err_Command41_Click:
MsgBox Err.Description
Resume Exit_Command41_Click

End Sub


Yet, what appears to me to be essentially the same bit of code compiles successfully

Private Sub Print_CRF_Click()
On Error GoTo Err_Print_CRF_Click

Dim stDocName As String

stDocName = "Follow-Up"

Me.Refresh

DoCmd.OpenReport stDocName, acNormal, "", "[Patient Number] = " & Me![Patient Number]

Exit_Print_CRF_Click:
Exit Sub

Err_Print_CRF_Click:
MsgBox Err.Description
Resume Exit_Print_CRF_Click

End Sub


Can someone out there explain what's going on here?
 
Are both of these command buttons on the same form?

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top