Writing Code

P

Peggy

I am very inpressed with people who write code. When we
newbies write quaries we just drag and drop fields in the
QBE view. If we have a problem sometimes the answer we get
tells us to include the following code.
Shriek.......Looking at SQL view scares us!
How do you get started knowing how to write this code? My
Access book doesn't even mention it. Is there a very, very
simple code writing book?
 
K

Ken Snell

Here's a good one:

"SQL Queries for Mere Mortals" by Michael Hernandez and John Viescas (ACCESS
MVP).
 
A

Albert D. Kallal

You should be aware that writing sql is NOT the same as writing code.

Ms-access have a very good query builder, and you can even write your own
sql by hand if you want.

However, in addition to be able to write sql, you can also write code to do
useful things. Writing code in ms-access is has nothing to do with sql,
well, ok, when you write code, you likely will often use some sql also. I
just wanted to stress that writing code, and writing sql is a separate issue
here.

Just about any intermediate book in ms-access will introduce you to writing
some code.
 
L

Larry Linson

Often, we post SQL that comes from Queries built in the Query Builder
(though perhaps with extraneous table names and parentheses) eliminated.
Many of the SQL statements that are posted can be copied and pasted into the
SQL view in Query Builder and then modified using the Query Builder grid
design view.

But, if the SQL posted is being built in code and saved in a variable, you
usually have to understand some basics of referring to controls on forms
from code, and some rules for how quote marks are treated.

Larry Linson
Microsoft Access MVP
 
A

Airdale

Writing code mhhhh. Well to do more than just write some
simple things like subs and change some event procedures
then you need to learn quite a bit.

Its not something that you just start doing one day.
There are many good books and I recommend those by Deitel
since they are written like college textbooks and in fact
Prof Deitel teaching programming classes.

Pick a good beginner language like C. Not C++ or C##. Just
plain C. And Deitel has a good C textbook but it cost about
$50. You won't get anywhere with the 'C for Dummies' Or
"VBS in 10 Days" type of books.

I have been a programmer for 35 yrs and still am usually on
a 'learning curve' no matter what language. Its always a
learning curve.

As to coding in Access? Well a good Visual Basic book may
'map' over good enough. Other than that I have a lot of
books on VBA and Access coding but only ever found one that
really went into it in detail. All the 'Programming for
Access' deal mostly with forms, sql,data pages and the like
and pay short shrift to the actual constructs and coding.
Like how to really code Error Handlers correctly. Most do
it wrong.

Good luck then.

A retired IBM programmer.
 
D

Douglas J. Steele

Airdale said:
As to coding in Access? Well a good Visual Basic book may
'map' over good enough. Other than that I have a lot of
books on VBA and Access coding but only ever found one that
really went into it in detail. All the 'Programming for
Access' deal mostly with forms, sql,data pages and the like
and pay short shrift to the actual constructs and coding.
Like how to really code Error Handlers correctly. Most do
it wrong.

Try looking at the various versions of the Access Developer's Handbook,
published by Sybex and written by Litwin, Gunderloy, Getz and Gilbert.

Check http://www.developershandbook.com for details.
 
G

Guest

Thanks but I have the 'one' that I spoke of. I have at
least $200 in others and they are fine but it was a $19.99
one that had the real coding detail.

To prove my point about err handling I am reworking
someones elses code that was so bad the err handlers had
totally masked out all failures. It produced a result some
times but just becasue the err handlers kept it running
instead of showing the err msg.

Now I learned how to really use err and implement on-demand
tracing and traps. Good , real good books are hard to find
and worth the money.
 
G

Guest

I went to the website. Looks like very nice books. I saw
that one of the chapters explained how OWC was required to
run pivot tables. I just prior to that put up a post
detailing a install failure for Access 2002 (at least in
the Developers Edition) where it failed to install the OWC
and caused me a lot of grief with grayed out pivot table
toolbars and drop zones.

I may have to order these books. Thanks for the tip.
Preciate it.
 
M

M.L. Sco Scofield

As Albert already mentioned, SQL and code (VBA) are different things.

My favorite book for Access's dialect of SQL is the SQL chapter of the "Access 2002 Developer's Handbook" by Ken Getz, et. al. from
Sybex. (Also recommended by Doug.)

My favorite book for learning Access coding is "Beginning Access 2002 VBA" from Wrox.

After you learn about code, go back to the Developer's Handbook which as a lot of code throughout all of the chapters.

As Airdale said, learning to program takes a lot of time and dedication.

And if you would like to come to the "Mile High City" of Denver someday, I hold all kinds of Access classes, some of which cover SQL
and VBA. :)

--

Sco

M.L. "Sco" Scofield, MCSD, MCP, MSS, Access MVP, A+
Useful Metric Conversion #16 of 19: 2 monograms = 1 diagram
Miscellaneous Access and VB "stuff" at www.ScoBiz.com
 
G

Greg Surratt

I have been a programmer for 35 yrs and still am usually on
a 'learning curve' no matter what language. Its always a
learning curve.

Ahahh! So it's not just me! I wrote code in basic and the quick
basic 4.5 and then quit for a couple years. When I came back, there
was Visual Basic 4.0 and now we're up to Visual Basic 6.0 and .NET (or
am I still further behind than I give myself credit for? ;-()

Greg - who is still trying to figure out what 'modals' and 'classes'
are for????
 
C

ChrisO

Well there’s lots of good advice here except perhaps starting out in
“C”.

On the other hand, if you want to be caught out with syntax it might be
the best place to start, apart from machine code, because the syntax is
important in code.

A slightly different point of view…

What do you wish to use the code for? Write queries? SQL in code is
just a string.
That is to say for a query to be a query in code it must first of all,
at the very least, be a valid string.

Other things in Access, like the properties assigned to objects, are
also just strings… in the main.

So if I were just starting out, in a database environment like Access,
and wanting to learn coding techniques, I would go for string
manipulation first up.

All Basics, including VBA, are very good at manipulating strings
(text).

Even “C” starts out as “Hello World”.

Regards,
Chris.
 
M

Mike Painter

ChrisO said:
All Basics, including VBA, are very good at manipulating strings
(text).

Pick Basic is *very* good at manipulating strings, the rest are better than
they were 20 years ago but not by a lot.
 
B

Brendan Reynolds \(MVP\)

Like Sco, I recommend the Wrox Press book 'Beginning Access 2002 VBA
Programming' for an introduction to writing code in Microsoft Access. If you
have no previous programming experience at all, you may find it helpful to
read the Access VBA book in the Microsoft Press 'Step by Step' series first.
For a complete beginner, it's a good gentle introduction to the subject, but
it really starts with the very basics, and doesn't get very far beyond them,
so if you have any previous experience at all you'll want to skip that one
and go straight to the Wrox Press book.

As for SQL, as Larry says elsewhere in this thread, we often post SQL, even
though we may have created the query graphically, because it is plain text
and can be easily pasted into a newsgroup post. You can see the graphical
view of the SQL by pasting it into a new query in SQL view and switching to
design view. (Don't forget to change any example table or field names to
your real names first.)
 

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