I created my first Form, and placed a command box button. I placed the following code:
Private Sub Command335_Click()
MsgBox "OK"
End Sub
I do not get the msgbox "OK" ? What is wrong? Please help.
I created my first Form, and placed a command box button. I placed the following code:
Private Sub Command335_Click()
MsgBox "OK"
End Sub
I do not get the msgbox "OK" ? What is wrong? Please help.
I know it might seem obvious but is the buttons name command335?
In design mode when you click on the button and look at the properties window, is there anything next to onclick (there should be)
If there isn't then choose the enter code option.
Sent from my iPhone using Tapatalk
It sounds like you have a button and a subroutine to run but no instruction in the properties window to tell it to run a subroutine.
Sent from my iPhone using Tapatalk
I have the property set OK. The OnClick in the property sheet is set to point to the subroutine i posted above. Is there anything i need to do with options somewhere?
Can you attach your database using advanced button on here?
Sent from my iPhone using Tapatalk
Easier to see if I could see the db[emoji848]
OK here is the db:
MyFirstDatabase.accdb
I hope you can open it and help me find out the problem!!
I'm away from my pc for an hour but someone will sort it out. If not I'll have a look when I get home.
Sent from my iPhone using Tapatalk
It works perfectly as is for me. Very straightforward. Form with one button, event procedure for on_click.
Does any code execute? In version 2007 and later, when no VBA code executes, the problem is usually that the folder holding the database hasn’t been designated as a "Trusted" location.
Have no idea, with v2016, where to find the Options, as they appear to change the location with each new version that comes out, but find Options then look for a tab marked Trust Center or something similar, and then set a trust location to the Folder the database resides in.
Linq ;0)>
Linq,
Wonderful! It worked. I went to File-Options-Trust Center and marked the location as trusted location and it worked. Thanks for the help. Indeed, this is a great Forum.
Glad we could help!
Linq ;0)>