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?
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?