How to use button and textbox?

viperbyte

Registered User.
Local time
Yesterday, 21:15
Joined
Oct 1, 2011
Messages
12
Hi guys. New guy; first time here. I'm trying to get some work done by way of when a user clicks a button on a form. When I add a button to a form in Access 2003, it asks me what kind of button do I want:recordset, miscellanious, form, query, macro and so forth. I don't want any of those. I just want to call a sub routine that will do some SQL statements and eventually print a labels report. In the Visual Basic environment that I'm used to you can add a button and double click on it and code inside the empty event handler. But it's not like that in Access at all and I'm so lost. I need to be able to select a value in a calendar or be able to write the date in a textbox and then press the button to proceed. Can someone super duper please give me a hand with this?
 
  1. Go to Tools – Options – Forms/Reports and check 'Always use event procedures'
  2. When the Command Button Wizard pops up, simply click on Cancel.
  3. With the Command Button selected go to Properties - Events and double-click immediately to the right of the On Click Property box
This should take you to the Form's Code Module where you'll see something like
Code:
Private Sub Command0_Click()
[B][COLOR="Red"]'Place your code here[/COLOR][/B]
End Sub

Place your code where indicated in red.

You need to be aware, though, that although Visual Basic and VBA for Access come from a common ancestor (QuickBasic 4.5) they are different in many ways. A number of Functions with identical names perform differently, depending on which variation of the language you're working with.

Linq ;0)>
 
Last edited:
Thank you very much. That helped tremendously. Super thanks :)
 

Users who are viewing this thread

Back
Top Bottom