Nightowl4933
Tryin' to do it right...
- Local time
- Today, 06:47
- Joined
- Apr 27, 2016
- Messages
- 151
Hi,
I have a Form which I open from two different forms, but which would use the same code on the Click event to set the configuration of that form.
As I'm getting fed up changing the Click code on one form and then updating the code on the Click event of the second form, wouldn't it be easier for me to use the same code in a Function and call it from the Command button's Click event?
If I can do this, could it just be a case of writing it like this:
Public Function OpeningTheForm
...
...
End Function
The reason I'm asking is that I've written some code on the Click event of one form, but it doesn't work when I copy/paste it to the second. I get the error:
'Run-time error '424':
Object required
Thanks
I have a Form which I open from two different forms, but which would use the same code on the Click event to set the configuration of that form.
As I'm getting fed up changing the Click code on one form and then updating the code on the Click event of the second form, wouldn't it be easier for me to use the same code in a Function and call it from the Command button's Click event?
If I can do this, could it just be a case of writing it like this:
Public Function OpeningTheForm
...
...
End Function
The reason I'm asking is that I've written some code on the Click event of one form, but it doesn't work when I copy/paste it to the second. I get the error:
'Run-time error '424':
Object required
Thanks
Last edited: