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

Preload button to delete form created earlier by an object.

Status
Not open for further replies.

nrjhano

Technical User
May 9, 2000
19
0
0
SE
I have defined an object that calls and generates a form.
On the form I have save button that should save all information entered into the form and then close the form. The save button is preloaded onclick from my object:
btnCmdButton.OnClick = "=RemoveCondFormOnclickV(""" & _ frm.name & """)"

Then I have a module with following receiving statements:
Public Function RemoveCondFormOnclickV(frmname As String)
DoCmd.Close acForm, frmname, acSaveNo
End Function

This work as far as it goes and the form disappears.

However, I would like to define a private procedure within the same object that will be able to save the entered data before deleting the form. Before I load the button I tried to verify that my private function call works at all:
Private frm As Form
.
Call RemoveCondFormOnclick
.
Private Function RemoveCondFormOnclick() '(Bstring As Object)
DoCmd.Close acForm, frm.name, acSaveNo
End Function

This does not seem to work at all. I have also tried to
"set frm = nothing". Any ideas? I suspect it has something with references to do but it worked for the module, see above!

I intend to preload the button with an object call. This seems to be a tricky thing to do because my object is unknown in the form. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top