473,395 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

MS Access - Forms - VBA Code with Command Click

Hello All,

This hopefully is a question that in theory should be very simple for someone to answer.

I've created a basic Form and "Button" then "built the event" and pasted in my VBA code for the event.

All I need to do now is have the code execute when the button is clicked.

Can anyone help me with the steps to do so?

I am not a programmer and for this button these are series of basic "update queries" that need to be run.

Alternatively, if I can execute a module (vs pasting in the code as an event) this same way with a button that would also work.

Regards,

Kyle
Apr 10 '15 #1
3 1767
Seth Schrock
2,965 Expert 2GB
In the properties window, select the Event tab and select the On Click line. An elipsis button (three dots) will appear. click it and that will create the event procedure that will run when it is clicked, or it will tie the event to the procedure you have already in place if it is setup correctly. You can also call the name of your procedure (assuming that the proper Private/Public assignment was given to it and depending on the location relationship between the event and your procedure) from the OnClick event.
Apr 10 '15 #2
zmbd
5,501 Expert Mod 4TB
Just to build on Seth...
Follow Seth's instructions, this will insert
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command11_Click()
  2. 'Cut and paste your code here :)
  3. '
  4. End Sub
  5.  
Command11 is a generic name, it will be replaced by the name you gave your button when you created it... or if you used the default name... then it might actually match :)
Apr 18 '15 #3
Thank you both!! Sorry for the late reply, I assumed I would get an email telling me someone responded. That was, as I suspected very easy.
Apr 21 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Kim Skytte | last post by:
HI! I have a few questions about access . 1) Does anyone know if it is possible to apply skins to Access forms ?? 2) Is is possible to hide the main access windows, and just show the forms.
7
by: James Fortune | last post by:
In response to different users or situations (data context) I transform the appearance and characteristics of Access Forms through code. This seems to fit in with the idea of polymorphism. Do...
7
by: dtecmeister | last post by:
Looking to see how many people could use this kind of tool. I've got several large databases I've developed in Access with MySQL as the back-end. I've started using Linux instead of windows and...
7
by: mumbaimacro | last post by:
hi i am using Adobe pdf reader ActiveX in ms-access, I have given in form load() Private Sub Form_Load() Dim FILENAME As String FILENAME = "D:\SAMPLES\Test.pdf" AcroPDF5.LoadFile FILENAME
0
by: annivanova | last post by:
Hi, I saw posts in Dependent listboxes on access forms, which problem is very similar to my. I’m from Bulgaria and working over to create an MS Access application. I used in my project given code...
4
by: paratge | last post by:
Hi, I'm updating one form in an iframe, with another in a main page. That works fine, th probliem is how to submit two forms with one click. For now i get an error "permission denied" how can...
2
by: =?Utf-8?B?UGV0ZQ==?= | last post by:
Happy New Year everyone. Quick question: does anyone know a good tool for converting Access forms into VB.Net form? Pete
2
by: Luting | last post by:
Hi, Is it possible to update oracle via Access forms? I am thinking maybe I could make a link table connnected with oracle database. And the form could be based on the link table. Does this...
6
by: desertavataraz | last post by:
This is Visual Basic 2008: I have an application where I have the main textbox on the main form, and the search window on a seperate form, and whenever someone clicks the mouse in the main forms...
3
by: TrevoriousD | last post by:
Hi I want to list my unhidden access forms, reports, in a combo box. this is the piece of code i already use and it works great but it also shows me the hidden objects. I don't know how to exclude...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.