Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jun 2003
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VB Scripts (Access XP)

    This may sound like a really stupid question, however . . . . I am writing some VB in an Access XP database and none of the scripts will run. I've taken some from an Access97 database and copied them in and i've written a very basic script just to change a font color and that wont compile either.

    Every time you try to run the script it asks for a macro name and then if you put a name in it creates a fresh macro rather than running the script you are currently in.

    I hope someone can shed some light on this and that I'm not just being completely stupid!!!!!

    Thanks

    <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

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

    Re: VB Scripts (Access XP)

    It might be a references problem. Access 2000/2002 by default use a different Data Model.

    In the Visual Basic Editor, select Tools | References...
    Clear the check box for Microsoft ActiveX Data Objects 2.n Library
    Locate and tick the check box for Microsoft DAO 3.6 Object Library
    Click OK

    Can you compile the code now? If not, copy an example of code that will not compile to the clipboard and paste it into a reply. Indicate where you get a compile error.

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB Scripts (Access XP)

    From what you're saying, you are trying to use the run button from the menu.

    In A97 if I remeber correctly, this Run button will run the code and enable the form to be visible.

    In Axp, this doesn't happen. When you press the Run button, you are asked for a macro !!!

    Obviously Microsoft changed the function on the various upgrades (A2000 - Axp) so it works differently.

    So this is really not a solution to your question, only a brief explanation.

  4. #4
    Star Lounger
    Join Date
    Jun 2003
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB Scripts (Access XP)

    Thanks, that is exactly what is happening. I have changed the settings as given previously and am no longer getting compile errors.

    Thanks

Posting Permissions

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