Documentation, anyone?

G

Guest

Hi

I've just started developing an Access application. I've got a lot of years of database design and development behind me using Oracle, and lots of class time in Java, so I'm very familiar with all of the basics, and a lot of the more advanced concepts (e.g., OOD, etc.)

My biggest problem is documentation. For any given type of object, what methods are available? What properties? For example, I've got a simple login form, with a username field and a password field and a "submit" button, and if the user hits the <enter> key while in the password field I'd like the form to automatically click the "submit" button. So I figure I need to add code to the form module in a subroutine for the "Enter" event for the Password field. But I can't find any online documentation for all of the Access objects in an easy-to-navigate form, either in the Access Help or at the Microsoft site

With Java, it's a piece of cake: I haven't used it in a couple of years, but it still took me all of about three minutes to find the API reference on the Sun site, find the "Button" class, and find all of the methods available. I had forgotten how the event process works in Java, and found that it would be more difficult to code what I'm trying than I had thought -- maybe 10 lines instead of 1 -- but it was still easy to find the documentation I was looking for

Is there some online (Access help, VBA help, Microsoft website, wherever) place where I can find all of the property/method information for all of the classes, and just drill down until I get to the object I'm looking for

Thanks
Rich
 
A

Allen Browne

Hi Rich.

Welcome to the Access world. Many in this forum can probably identify with
you feeling that there is *so* much to learn, so please be patient with
yourself. There are usually half a dozen ways to do anything in Access, so
once you have found one, and then another, you still have to figure out
which is the most appropriate, and then which is the most efficient.

For the particular example you give, just set the Default property of your
command button to Yes. No code needed.

To get started, work through the example in the Northwind sample database
that installed with Access. Start by examining the relationships (Tools
menu) to get the picture of how the relational data structure fits together.
When you want to start on the code, open the Orders form, check out its
RecordSource (so you can see what data is available), and see what events
are used and how the subform fits with the main form.

After that there are many sites for specific tips.
My favorites are linked from the one below.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Rich said:
I've just started developing an Access application. I've got a lot of
years of database design and development behind me using Oracle, and lots of
class time in Java, so I'm very familiar with all of the basics, and a lot
of the more advanced concepts (e.g., OOD, etc.).
My biggest problem is documentation. For any given type of object, what
methods are available? What properties? For example, I've got a simple
login form, with a username field and a password field and a "submit"
button, and if the user hits the <enter> key while in the password field I'd
like the form to automatically click the "submit" button. So I figure I
need to add code to the form module in a subroutine for the "Enter" event
for the Password field. But I can't find any online documentation for all
of the Access objects in an easy-to-navigate form, either in the Access Help
or at the Microsoft site.
With Java, it's a piece of cake: I haven't used it in a couple of years,
but it still took me all of about three minutes to find the API reference on
the Sun site, find the "Button" class, and find all of the methods
available. I had forgotten how the event process works in Java, and found
that it would be more difficult to code what I'm trying than I had
thought -- maybe 10 lines instead of 1 -- but it was still easy to find the
documentation I was looking for.
Is there some online (Access help, VBA help, Microsoft website, wherever)
place where I can find all of the property/method information for all of the
classes, and just drill down until I get to the object I'm looking for?
 
T

TC

Hopping in here (cos I can't see the original post):
years of database design and development behind me using Oracle, and lots of
class time in Java, so I'm very familiar with all of the basics, and a lot
of the more advanced concepts (e.g., OOD, etc.).
methods are available? What properties? For example, I've got a simple
login form, with a username field and a password field and a "submit"
button, and if the user hits the <enter> key while in the password field I'd
like the form to automatically click the "submit" button. So I figure I
need to add code to the form module in a subroutine for the "Enter" event
for the Password field. But I can't find any online documentation for all
of the Access objects in an easy-to-navigate form, either in the Access Help
or at the Microsoft site. years,
but it still took me all of about three minutes to find the API reference on
the Sun site, find the "Button" class, and find all of the methods
available. I had forgotten how the event process works in Java, and found
that it would be more difficult to code what I'm trying than I had
thought -- maybe 10 lines instead of 1 -- but it was still easy to find the
documentation I was looking for.

How is it any different in Access? Select a command button in design view.
Display its properties window. Look through all the properties. Voila:
'Default' (? - can't quite remember its name), which does precisely what you
want.

TC
 
A

Albert D. Kallal

This will sound a bit lame..but the first place to look is in the help file.
(bear with me...as I will give a few tips on using help).
My biggest problem is documentation. For any given type of object, what
methods are available? What properties?

Of course while in the code IDE, the editor does use inteli-sense. (for each
object..a list of methods/properties automatically pops up). However,
inteli-sense don't help when you don't know what objects you have
available!
For example, I've got a simple login form, with a username field and a
password field and a "submit" button, and if the user hits the <enter> key
while in the password field I'd like the form to automatically click the
"submit" button.

It turns out the above feature is built into a form. If you set ANY BUTTON
on the form defaults property to "yes", then when you whack enter...it will
be pressed. You will find this setting for the button in the "other" tab of
the properties sheet. In the other tab..you will also find a "cancel"
setting, and if set = yes...then if the user hits Esc key...then the button
is pressed.
So I figure I need to add code to the form module in a subroutine for the
"Enter" event for the Password field

Nope..actually the "enter" event is when the cursor moves into the
field....a very useful event for pre-processing of data for the
control/field (setup code for the control for example). You also have the On
Got focus event. Both of these events fire when the control gets the
focus.....but they are used for different things. This is problem with
ms-access..you have SO MANY events. So, just to be clear..the On Enter event
is not related to the enter key. (help tip: put your cursor in a event
setting in the property sheet...and whack help). (if you want...please feel
free to ask the difference between these two very similar events...and
why/when you would use one over the other).

I going to state right now that ms-access forms has about 2 or 3 times the
events, properties that VB has. This actually means that access forms while
easy to use right out of the box...those forms in fact have a MUCH steeper
learning curve then do VB forms. However, the code event you could use to
make the Enter key do what you want is the On Key Down Event. The key down
event fires each type you type a character..so we *could* use that event.

Private Sub txtSearch_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then

KeyCode = 0 ' suck keypress into black hole...we don't want
the cursor moving

'Call MycloseCode

'or..you could even call the same code for the button code on your ok
button or whatever

Call Command13_Click


End If


End Sub

And, for key constants...you could have used:

If KeyCode = 13 then
But I can't find any online documentation for all of the Access objects in
an easy-to-navigate form, either in the Access Help or at the Microsoft
site.

The help is split between both the user interface..and the code interface.
So, while in the code editor..go

Help->Visual Basic Help.

Click on the contents tab. There is not bad drill down in that case.

You also will find out that some things work a bit differently. For
example...you don't need a grid control...but can use forms to display data
as a grid.

Take a quick look at the following screen shots to get an idea of what I
mean...

http://www.attcanada.net/~kallal.msn/Articles/Grid.htm
 
G

Guest

Thanks to Allen, TC, and Albert for the help. I tried the "Default" property on the button in question, and it worked as described. And thanks for steering me in the correct direction on the "On Enter" event, Albert; I didn't consider the possibility of "enter" referring to entering the field

I still have the larger question about documentation. As Allen suggested, I have been using the Northwind sample database *extensively* for borrowing code and concept ideas (it's nice that the function of the Northwind database is similar to what I'm creating!). But while having real-world-style examples is very helpful, it's not comprehensive, and the help is not in a consolidated location. I tried TC's suggestion about hitting the F1 key while on a property for a CommandButton, and sure enough, a context-specific help file opened; but as a beginner, it will be somewhat tedious to go through every property, one-by-one, for every object that I use to find out what it does. On top of that, if I forget, finding it again might be difficult. In the example that I gave, I didn't think my solution would be found in a property, I thought it would be found in a method, so I wouldn't have checked the properties one-by-one early on even if I'd known about the context-specific help. And I've drilled down in the Visual Basic editor help, but it doesn't seem organized or comprehensive to me; in the example that I gave, I looked up "CommandButton" and "CommandButton method" and very little was available, most of it referring only to what a CommandButton is

What I'm looking for is something like the Java API documentation, which can be found here

http://java.sun.com/j2se/1.4.2/docs/api

All classes are listed, so you can look up all of the properties and methods for a given class in one place. Even if you're not sure what the class is, you can drill down in a specific package and probably find it. In my example, I could have looked up a CommandButton, and while scanning the properties I might have seen that the "Default" property would handle my situation; I think it would have been more likely, anyway, than my just "figuring out" that the CommandButton object has a property that accomplishes what I needed to do

Thanks again for your suggestions. Even if there's no comprehensive, organized, easily-accessible reference like what I'm looking for, clearly this is a good forum for assistance

Rich
 
A

Albert D. Kallal

What I'm looking for is something like the Java API documentation, which can be found here:

http://java.sun.com/j2se/1.4.2/docs/api/

All classes are listed, so you can look up all of the properties and
methods for a given class in one place. Even if you're not sure what the
class is, you can drill down in a specific package and probably find it. In
my example, I could have looked up a CommandButton, and while scanning the
properties I might have seen that the "Default" property would handle my
situation;


I agree. (by the way..many of us think the help system was damaged when
a2000, and a2002 (xp) came out).

However, I am now starting to learn how to get around.

Here is great drill down tip (I am assuming access 2002).

Open your application (hold down shift key to by-pass start-up options if
you have any!).

whack ctrl-g (this brings to the debug window (visual basic ide).

Now, whack f2. You get the object browser.

On the left side..click browse down until you find "commandbuttion". Click
on "commandbutton". Now, on the right side you will see all properties..and
all methods..if you highlight any method/property and whack help...you get
the help. So, highlight default..and whack help (f1)....
 
A

Allen Browne

Perfectly understandable.

When Access version 1 was released (1992), it came with a comprehensive
reference manual and a tutorial, so it was possible to learn the software
and find the stuff you needed using those. Now you have to buy the reference
and tutorial stuff separately. It would be very difficult to learn all the
stuff in Access without buying some more reference material.

John Viescas book Access 2003 ("Inside Out" series, published by Microsoft
Press), is readable and covers most of what you need. If you want the
standard developer's book, it's Ken Getz et al, MS Access xx Developers
Handbook published by Sybex (where xx is your version).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Rich (thanks for the tips!) said:
Thanks to Allen, TC, and Albert for the help. I tried the "Default"
property on the button in question, and it worked as described. And thanks
for steering me in the correct direction on the "On Enter" event, Albert; I
didn't consider the possibility of "enter" referring to entering the field.
I still have the larger question about documentation. As Allen suggested,
I have been using the Northwind sample database *extensively* for borrowing
code and concept ideas (it's nice that the function of the Northwind
database is similar to what I'm creating!). But while having
real-world-style examples is very helpful, it's not comprehensive, and the
help is not in a consolidated location. I tried TC's suggestion about
hitting the F1 key while on a property for a CommandButton, and sure enough,
a context-specific help file opened; but as a beginner, it will be somewhat
tedious to go through every property, one-by-one, for every object that I
use to find out what it does. On top of that, if I forget, finding it again
might be difficult. In the example that I gave, I didn't think my solution
would be found in a property, I thought it would be found in a method, so I
wouldn't have checked the properties one-by-one early on even if I'd known
about the context-specific help. And I've drilled down in the Visual Basic
editor help, but it doesn't seem organized or comprehensive to me; in the
example that I gave, I looked up "CommandButton" and "CommandButton method"
and very little was available, most of it referring only to what a
CommandButton is.
What I'm looking for is something like the Java API documentation, which can be found here:

http://java.sun.com/j2se/1.4.2/docs/api/

All classes are listed, so you can look up all of the properties and
methods for a given class in one place. Even if you're not sure what the
class is, you can drill down in a specific package and probably find it. In
my example, I could have looked up a CommandButton, and while scanning the
properties I might have seen that the "Default" property would handle my
situation; I think it would have been more likely, anyway, than my just
"figuring out" that the CommandButton object has a property that
accomplishes what I needed to do.
Thanks again for your suggestions. Even if there's no comprehensive,
organized, easily-accessible reference like what I'm looking for, clearly
this is a good forum for assistance!
 
G

Guest

Thanks again! The Object Browser is almost exactly what I'm looking for. I just wish that there was some text for each property and method, even just one line, indicating something about its use. I would never assume that "Default" in the case of a CommandButton would refer to the button being the default button for a form, I would assume it would have something to do with the button's default behaviour, and would therefore likely pass over it while scanning. Nevertheless, I'm sure the Object Browser will help me tremendously

I haven't heard of the John Viescas book, I'll look for it. I currently have the Access 2000 Developer's Handbook checked out of the library, and it is proving very helpful; if it looks like I'll be doing more with Access, I'll definitely get a copy. (Or upgrade to 2003 first, then get a copy of the new one.

Thanks again!

Rich
 
T

TC

(snip)

organized, easily-accessible reference like what I'm looking for, clearly
this is a good forum for assistance!


The existance of these usenet forums has revolutionized the help that
developers of all levels can get, IMO. In the old days, you either worked it
out yourself - or simply didn't get to know it!

Cheers,
TC
 
A

Allen Browne

TC, you may be interested to know that the newsgroup
comp.databases.ms-access has been providing this kind of help for many
years - since before I started using it in 1994.

So, yes, I have to agree that it was a major contributer to whate I have
learned over the years.
 
J

John Vinson

TC, you may be interested to know that the newsgroup
comp.databases.ms-access has been providing this kind of help for many
years - since before I started using it in 1994.

And CompuServe forums were providing similar help even earlier than
that.
 
T

TC

Guys, when I said "in the old days", I meant, like, the late 1960s !!! (and
not restricted to msaccess info)

Cheers (creak),
TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top