Code ?

B

Bandit

This may sound really stupid, so please bear with me. I have been following
this forumn for about six months now and have learned alot. But, I keep
seeing something along the lines of this: "Put this code behind this button,
etc" . I am not school trained on this and am just trying to learn as I go
and get the job done that has been assigned to me. I have learn alot from
this board and appriciate all the input. I have viewed prior posts that go
back, well lets just say way, way back. But I often see something that says
put this code into your form, etc. Just where exactly does this code go?

Thanks and please don't think I am a total idiot for asking this questions.
But I just don't know where to put it.

Thanks again, you all our a wealth of knowledge.
 
D

Douglas J. Steele

It depends on the specific code being suggested. If the suggestion is for
code for a specific event for a specific control, the easiest approach is to
open the form in design view, select the control in question, then look at
the Properties window. Find the appropriate Event for that control, change
the property for the event to [Event Procedure], then click on the ellipsis
(...) to the right of the property. That'll take you into the VB Editor,
where you can paste the code in question.
 
J

John W. Vinson

But I often see something that says
put this code into your form, etc. Just where exactly does this code go?

Open the Form in design view. Find the appropriate event - for instance, if
you want code to run when you click a command button, view the button's
properties; on the Events tab find the "Click" event, and click the ... icon
next to the property. Access will open the VBA editor window and give you two
lines for free:

Private Sub buttonname_Click()

End Sub

You can then copy and paste the suggested code from the website, changing the
names of controls, fields, tables, etc. as needed to match your own
application.

You will need to do some work to understand the many different events, when
they're used and how. There are some good pointers at:

Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html

The Access Web resources page:
http://www.mvps.org/access/resources/index.html

A free tutorial written by Crystal (MS Access MVP):
http://allenbrowne.com/casu-22.html

MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials

John W. Vinson [MVP]
 
B

Bandit

Thank you very much

I always learn so much here.I will definatley check out those websites. In
my spare time, I have just been reviewing all the different websites about
access and doing all of the tutorials on MS Office.

Thanks again,
 
Top