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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling the EndEdit event - syntax question

Status
Not open for further replies.

cdipaolo

Programmer
May 1, 2002
36
US
I have the following code which is designed to show two buttons (save and cancel) when the user finishes editing a spreadsheet object in an Access form.

Private Sub wks1_EndEdit(Accept As Boolean, FinalValue As Variant, Cancel As Variant, ErrorDescription As Variant)
Form_RefAn_UnitData.cmdSaveChg.Visible = True
Form_RefAn_UnitData.cmdCancelChg.Visible = True
End Sub

I have tried replacing the "Variant" text with "Object" and "ByRef". I'm obviously new to this so I'm missing something in the syntax here.

It is described in the documentation as either:
Private Sub Object_EndEdit(ByVal Accept As Boolean, ByVal FinalValue As ByRef, ByVal Cancel As ByRef, ByVal ErrorDescription As ByRef)
or
Event EndEdit(Accept As Boolean, FinalValue As ByRef, Cancel As ByRef, ErrorDescription As ByRef)
 
FYI, I needed to put the text "ByVal" in front of the variables that were being passed in.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top