Run AutoExec macro in the backend access db (1 Viewer)

theDBguy

I’m here to help
Staff member
Local time
Today, 16:50
Joined
Oct 29, 2018
Messages
21,358
Congratulations! Now, you're a VBA user. Good luck with your project.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:50
Joined
Oct 29, 2018
Messages
21,358
many many many thanks

and how should i run it :rolleyes: another beginner question
Well, now, you can create a macro in the FE and use the RunCode action to call the function name. You can then run the macro however you decide to. For example, you can use a button to call it.
 

AsMok

IT IS ME ^_^
Local time
Today, 16:50
Joined
Sep 4, 2019
Messages
64
Well, now, you can create a macro in the FE and use the RunCode action to call the function name. You can then run the macro however you decide to. For example, you can use a button to call it.



:confused:
:confused::confused:
after i created a runcode macro
 

Attachments

  • Picture1.jpg
    Picture1.jpg
    68.3 KB · Views: 223

theDBguy

I’m here to help
Staff member
Local time
Today, 16:50
Joined
Oct 29, 2018
Messages
21,358
Can you show us the macro?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:50
Joined
Oct 29, 2018
Messages
21,358
Okay, I think I understand. Since we are using a macro, you'll need to call a function. What we just created was a sub. So, go back to the code and change

Public Sub

to

Public Function

And also, change

Exit Sub

to

Exit Function
 

AsMok

IT IS ME ^_^
Local time
Today, 16:50
Joined
Sep 4, 2019
Messages
64
Okay, I think I understand. Since we are using a macro, you'll need to call a function. What we just created was a sub. So, go back to the code and change


Public Sub


to


Public Function

yes that is the problem

and I add () to the function name

now it works great

many many many many many thanks for your great help :)
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:50
Joined
Oct 29, 2018
Messages
21,358
Hi. I rarely use a macro, so I never planned on this before. Glad to hear you got it sorted out. Cheers!
 

Users who are viewing this thread

Top Bottom