Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Newbie Dumb Question (2002)

    <img src=/S/nosleep.gif border=0 alt=nosleep width=27 height=15> I'm trying to make that quantum leap from "wizard" world to learning VBA, and have managed to get to pg 88 of "Beginning Access 97 VBA Programming" without too many mental failures. However, here I am at 'Module Variables' and can't seem to figure out how to make the entry. It says to make an entry in the (Declarations) section of the module window under the Option statement, but when I open (General) > (Declarations) it is displaying "Option Compare Database" with the cursor at the beginning. When I move to the end and hit return it moves me out of the option statement into the sub below it. Are you supposed to delete "Option Compare Database" first? I've heard for fifty-two years that there is no such thing as a dumb question, but I may have finally discovered the exception.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Newbie Dumb Question (2002)

    The top of a module could look like this:

    Option Compare Database ' general options
    Option Explicit

    Public Const Pi = 3.141592 ' a constant

    Dim strName As String ' some variables
    Dim lngAmount As Long

    Sub Test() ' the first procedure
    MsgBox "Hello World"
    End Sub

    To see it (more or less) like this, you need to have checked "View Full Module" (don't know the exact caption) in the options of the Visual Basic Editor. If this option is unchecked, you'll just see bits at a time.

    If you can't insert a new line with the Enter key, you either have a keyboard problem or the Visual Basic Editor has gone haywire. See if closing all applications and restarting your computer helps.

    Note: if you didn't get Option Explicit, rush to Tools/Options... in the Visual Basic Editor and turn on "Require Declarations". This forces you to declare ALL your variables and constants; it will save you a lot of grief later on. If declarations are not required, any typo will create a new variable without you knowing it: if you type lngAmuont instead of lngAmount, you'll have a new variable that has no connection at all with lngAmount.

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Newbie Dumb Question (2002)

    Option Explicit was not checked, and even when I changed it in Options it did not appear in that module. I opened a new module and it DID appear. I went back and re-created the subs from the lesson and everything is working fine now. I suppose you can't change the options in an active module once the routine has been entered? Anyway, thanks for getting me back on course. BTW, I went back to the original module and just deleated the text "Option Compare Database" and entered the text from the lesson, and the routine worked there as well (although it isn't Option Explicit). Thanks again for your help.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  4. #4
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Newbie Dumb Question (2002)

    <hr>I suppose you can't change the options in an active module once the routine has been entered?<hr>
    You sure can. All you have to do is type:

    Option Explicit

    as the first line in the module.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Newbie Dumb Question (2002)

    The setting for Option Explicit is applied only to new modules, as you found out.

    However, you can always add Option Explicit and/or Option Compare Database to any existing module, or remove it if you so wish. After all, a module is just text.

    For your information: there are three forms of Option Compare. They determine how text is sorted and compared

    Option Compare Binary: uses the internal representation of characters, so is case-sensitive. In this setting, A < a <

  6. #6
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Newbie Dumb Question (2002)

    Thanks! I suppose if I'm going to get anywhere with this VBA lesson, I'm going to have to get away from the "point and click" mentality. At 52 it's even difficult getting past the "...old dog, new tricks." syndrome. I managed to inherit XP Developer, which got me interested in this whole VBA thing to begin with. Having Developer, with my level of expertise, is a little like giving a Ferrari to a 13 year-old, but, what the hell; I'm willing to give it a shot!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  7. #7
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Newbie Dumb Question (2002)

    Thanks again Hans! (Please see previous)
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  8. #8
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Newbie Dumb Question (2002)

    It's NEVER to late to "teach and old dog new tricks".

    I have help someone from South Africa learn VBA who is retired and in their 60's, so it's never too late.

    But I'm jealous. Inheriting XP deleloper. Sheesh!!
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  9. #9
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Newbie Dumb Question (2002)

    Now wait just a minute! <img src=/S/stop.gif border=0 alt=stop width=26 height=24> *I'm* over 52, and I'm learning something new every day! <img src=/S/baby.gif border=0 alt=baby width=15 height=15>

    And just for your information, you can always post your questions on Access VBA in the Access forum. There are more Access people hanging out there, and since Access uses different forms and controls than the rest of Office, you'll probably get faster and more directed answers there ... unless Hans and Bryan and a few others happen to be lurking in this forum when you post, of course. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Charlotte

  10. #10
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Newbie Dumb Question (2002)

    <img src=/S/stop.gif border=0 alt=stop width=26 height=24> Now wait just a minute there Charlotte <img src=/S/exclamation.gif border=0 alt=exclamation width=15 height=15>

    I DON'T lurk. <img src=/S/hmmn.gif border=0 alt=hmmn width=15 height=15>

    I hang out <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  11. #11
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Newbie Dumb Question (2002)

    I really didn't "inherit" it so much as it inherited me, I guess. The company I was working for went out of business, and I was offered some of the old equipment at "bargain" prices a few weeks later. Everything had kind of been piled up in one room with boxes of towers, keyboards, monitors, printers, etc. I really was looking to see if the old server was still around or maybe some of the later model PC's, but most of the "good" stuff had been liquidated. I ended up taking a box that had two towers (one with a tape drive), a bunch of cable, and at the bottom a bunch of loose floppies, manuals, and CD's. I was going to pull everything out and just dump it into another box, but the cables were all tangled up with everything and there were no empty boxes anyway - so I took the whole thing home to clean out there. It sat in the corner of my home office for 2 weeks before I started going through it all.

    At the very bottom of the box, under all the manuals and scattered floppies was this UN-OPENED box labled "XP Developer". I didn't even know what it was. I opened it up and find 7 CD's inside with things like Media Content, SQL Server, Exchange 2000, Visual SouceSafe, Developer, and Office XP w/FrontPage. I didn't know what the other stuff was, but I knew what Office XP was and I got, well, a bit giddy. Really, I was like a kid on Christmas morning. Why? Because when I got there I found out that they weren't taking any checks and I only had $47.00 in cash on me. I knew the tape drive was well worth the money (even though its rather dated) so they took what I had on me just to get rid of the "garbage".

    Sorry I rambled on so long, but it's rare that I encounter such good fortune, and felt a need to share with someone who could appreciate the story (my daughters just looked at me blankly and said: "That's nice"). Anyway, now I feel somehow obligated to learn VBA so as not to jinx the genie in the bottle so to speak.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  12. #12
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Newbie Dumb Question (2002)

    Could have fooled me. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15> Don't forget, I see you posts in another list ... <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>
    Charlotte

  13. #13
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Newbie Dumb Question (2002)

    <img src=/S/blush.gif border=0 alt=blush width=15 height=15> Sorry, I didn't mean to offend any of my peers! <img src=/S/gramps.gif border=0 alt=gramps width=20 height=20>
    Thanks for the forum tip; I will do so in the future.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  14. #14
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Newbie Dumb Question (2002)

    I wasn't offended. I just wanted to go on record as not quite over the hill yet (but I am picking up speed ... ) <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Charlotte

  15. #15
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Newbie Dumb Question (2002)

    ...and still maintaining a good sense of humor. Gotta love that!
    <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23> <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30> <img src=/S/fanfare.gif border=0 alt=fanfare width=31 height=23>
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •