Solved

Compile error

Posted on 2014-01-03
2
323 Views
Last Modified: 2014-01-04
I am trying to modify the code in this article on staging data to suit my database needs.  http://www.experts-exchange.com/A_6692.html  When I run the code I get a compile error.  The form is tempServices.  Select a sample number, select a category then click Load Services - that's where the error comes up.  I am uploading a data stripped version of the front and back end if someone would like to have a look at it.

I am also wondering how to modify the code to select all categories and then load ALL services?
Thanks!
NBDC-be.accdb
NBDCv203.accdb
0
Comment
Question by:esbyrt
2 Comments
 
LVL 24

Accepted Solution

by:
Bitsqueezer earned 500 total points
ID: 39755849
Hi,

that thing is full of errors. The first thing you'll need to do is to add an "Option Explicit" at the top of EACH module (modules, form modules, report modules) where it is not already there. Then use "Debug"-"Compile" in the VBA editor and correct each error it presents, in all modules. My first quick try to do that throws several errors in several modules. I don't think that anyone else has the time to completely rework your database to get at least a running one (or at least your problematic form). The form with the compile error has for example a missing "End Sub", a missing jump label, a recordset where you try to access the field with "." instead of ! (or at least .Fields("Name")), the backend could not be connected completely as there are missing tables in the table manager, the problematic form throws an error of a missing table, and, and, and...

Last but not least: Please write the used Access version into any question so it is easier for the experts to decide if they download it or not. In your case it is A2010 which makes it impossible to use your demo database with a lower version.

In general it looks as if you would have copied and pasted the code of another database without changing field names and so on to fit your needs.

Cheers,

Christian
0
 

Author Comment

by:esbyrt
ID: 39756433
Hi Christian.  Thanks for taking a look.  I'm sure part of the problem is that I was trying to post as little as possible of my working database onto the internet for public access.  I must have left out some tables.  And yes, I did copy the code for the problem form from a demo database and change the field and form names to match my database.  I guess I will have to go through and correct the errors you spotted before I can go further with it.
Thanks again.

Edit - had another look at my database - most of the problems you found were from a form I was mucking around with and had discarded but not deleted yet.  My bad.  I will clean this up and repost after.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

823 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question