Can you show us the code in the Click event of the button please? Thanks.When I click the button manually, it works. It opens another form. When I use Command5_Click I get an error.
Just call the click event.
Ah, that's an embedded macro. Not sure you can execute it another way aside from clicking on the button. If you must use macros, you might use a named macro instead. Otherwise, you could repeat/duplicate the macro in your other code. Just a thought...Here is what's in the command button.
View attachment 98482
Hi. Glad to hear you got it sorted out. Good luck with your project.Yes, that did it. Thanks!
Why?Not considered good practice.
It's better it you put the command button code in its own routine and call that from the command button and elsewhere....
Why?
does anybody still think it belongs in a Standard Module? Just curious...
It should immediately be converted into VBA
But I was referring to its content (the code inside the macro). Even if you convert it into VBA, do you really think it should be in a Standard Module. I was just curious...Ha! Its a macro!
It should immediately be converted into VBA and the perpetrator of the offence should be banned from (AWF) Access World Forums!
If the code is only applicable to the command button, then leave it there.
where the button click code is simple and used in just one other place, I see no reason to create a separate procedure just for the sake of it