G
Guest
I have what is probably a silly question. Is there a way to run code that
applies to form1 from form2? I have a delete button in form1 that has a lot
of code in it that is specific to form1 like me.controlname = "test" etc. I
have a button in form2 that opens form1 to the last record. Now I need a way
to run the same code that's in the delete button on form1 without needing to
click the delete button. I copied the code to a module and tried to call it
from form2 with this code:
DoCmd.Close
DoCmd.OpenForm "NewPartInputfrm", , , , acFormEdit
DoCmd.GoToRecord , , acLast
Forms![NewPartInputfrm]![Model#] = "test"
Call DeleteNewRecord
This code works until Call DeleteNewRecord. Maybe I have the function
arguments wrong. I have: Public Function DeleteNewRecord().
All I want to do is once the button in form2 is clicked for the code behind
my delete button on form1 to run. Any ideas? Thanks.
applies to form1 from form2? I have a delete button in form1 that has a lot
of code in it that is specific to form1 like me.controlname = "test" etc. I
have a button in form2 that opens form1 to the last record. Now I need a way
to run the same code that's in the delete button on form1 without needing to
click the delete button. I copied the code to a module and tried to call it
from form2 with this code:
DoCmd.Close
DoCmd.OpenForm "NewPartInputfrm", , , , acFormEdit
DoCmd.GoToRecord , , acLast
Forms![NewPartInputfrm]![Model#] = "test"
Call DeleteNewRecord
This code works until Call DeleteNewRecord. Maybe I have the function
arguments wrong. I have: Public Function DeleteNewRecord().
All I want to do is once the button in form2 is clicked for the code behind
my delete button on form1 to run. Any ideas? Thanks.