Compile Error Procedure to Large

ddrew

seasoned user
Local time
Today, 08:22
Joined
Jan 26, 2003
Messages
911
Can anyone advise me how to make my coding smaller. Clearly the procedure is to big, but I have putit together the only way I know how. I'm sure it can be condensed. This all working from one button. I have attached the coding in a word document in the hope that itcan be simplified. If anybody would like the whole DBlet me know and I will gladley post it.
 

Attachments

Any chance of the db to understand the reason for the code?

Andy
 
Re:Compile Error

There you go. Had to be in 97 format im afraid. You may get a few errors from other stuff that ive had to strip out to make it small enough!
 

Attachments

The reason you are getting the error is because you have defined the if statement, but not closed the if statements by using :

Code:
End If

I will have a look at the db to see if we can change the code to reduce the if statements.

Andy
 
Re:Compile Error

Not sure I understand, the error it was throwing up was "Compile Error, Procedure to Large". Any other errors that you may be getting on top of that may be as a result of me having to strip out to make the DB small enough to post. The error was produced when I was copileing under the following command, Private Sub Command267_Click(). This can be found on Forms!Cadet_Kata_1_Round_1. Hope all this makes more sense to you than it does to me! If you need the whole thing let me have an email address and I will send it.
 
Ok, with your current code if you move all of the code for the cmd button and copy it into a module like this:

Code:
Public Function CallButton()

Your code goes here....

End Function

Then the code for the sub:
Code:
call callbutton

This will call the whole function in the same way. You will have to remove the 'Me' code, as you will get a error message "Invalid Use of Me Keyword".

Just use Find and Replace to remove the Me.

Andy
 
Re:Compile Error

Sorry Modules are a bit new to me. Can you explain some more. I took all of my code from that one command button, did module design started of by doing:

Public Function Callbutton() (Return). Then I pasted in all my code, removed all of the Me. and then saved the module as Callbutton

I then went back to my command button and wrote:

Private Sub Command267_Click()
Call Callbutton

End Sub

But I got the following error:

Compile Error: Expected variable or procedure, not module.

Any ideas?
 
See the txt file attached.

Just copy and paste the code into the module and try that.

Andy
 

Attachments

Re:Compile Error

OK done that but it produces an error on this line:

If R1 = x(1) Then Let Forms!Cadet_Kata_1!Cadet_Kata_1_Round_2!Name1 = Name1

The error appears on the Name1, right at the end of the line. The error message reads, Compile Error: Variable not defined. Help!
 
Re:Design Structure

Rich said:
Surely you have a major design problem with this structure?
I appreciate what you say, but as a begginer at this I can only design and build it by doing what I think may be right, I am open to ideas, but the scoring system dosent appear to be easy to implemnt into a DB. I tried once before, but only with sixteen entrents, Ive now moved up to 32 in each event. Hence the code is bigger. Like I say I am open to ideas!
 
You've re-created a spreadsheet in Access, the two are different. Try searching here first for articles on normalisation.
 
I don't get the error message.

Download the db(97 version) Here

Just import them into your db. Take a look

Let me know how you get on.


Andy
 
Re:Compile Error

Excuse my ignorance, but I am using XP, I only converted it to make it smaller for posting. Is there something different I should be doing for XP version?
 
No. I am using XP Professional and don't have any probs. I converted it to 97. Do you want it in 2000?

What errors are you getting now?

If still no joy i will send you my email address via PM.

Andy
 
Re:Compile Error

Sorry still getting the same error. Could you PM me and ill send the whole thing, so that you can see what ive done
 
Re:Compile Error

Posted this the other day, but I wonder if anyone else has other ideas. I understand what Rich says about it being a spreadsheet. But this is something that someone else will be using so it needs to look nice with an easy GUI, and not just a bunch of numbers and names on a screen. Unless someone has a way of making the same sort of thing in Excel!
 

Users who are viewing this thread

Back
Top Bottom