473,385 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

COMPILE ERROR: SUB OR FUNCTION NOT DEFINED

The above error occurs when I attempt to select any of the check boxes
that are within this code.

Private Sub Check39_AfterUpdate()
If Check39 = True Then
CheckboxTrue 1
Else: CheckboxFalse 1
End Sub

I am using Access 2003. I've tried everything I could think. Can anyone
help on this?

Thanks
Deenos

Apr 4 '06 #1
9 14329
De********@aol.com wrote in message
<11**********************@z34g2000cwc.googlegroups .com> :
The above error occurs when I attempt to select any of the check boxes
that are within this code.

Private Sub Check39_AfterUpdate()
If Check39 = True Then
CheckboxTrue 1
Else: CheckboxFalse 1
End Sub

I am using Access 2003. I've tried everything I could think. Can anyone
help on this?

Thanks
Deenos


Do you have subs or functions called CheckboxFalse and CheckboxTrue
within the current scope?

--
Roy-Vidar
Apr 4 '06 #2
De********@aol.com wrote:
The above error occurs when I attempt to select any of the check boxes
that are within this code.

Private Sub Check39_AfterUpdate()
If Check39 = True Then
CheckboxTrue 1
Else: CheckboxFalse 1
End Sub


CheckboxTrue and CheckboxFalse are functions or subs in the above code.
Put your cursor on CheckboxTrue and right click and select "definition"
(you'll need to scroll down to near the bottom of the pop up menu). If
you get a message saying something like "Identifier under cursor is not
recognized" then that's your problem - CheckboxTrue is not defined
anywhere. Do the same to test CheckboxFalse.

It is likely that either or both of these functions is not defined.
When you select the check box Access is trying to follow the above code.
If it can't find CheckboxTrue or CheckboxFalse it says to itself "what
is this silly user trying to make me do? I just don't understand!" and
throws the error you are experiencing.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Apr 4 '06 #3
Thanks. It worked. I did not define it.
But now i am getting this error message that the database could not
find this form Mothers Information. The form name is spelt correctly
and does exist. Here is the code:

Public Function CheckBoxTrue(X As Integer)
Dim dbThe_Mothers_Circle As DAO.Database
Dim rstType As DAO.Recordset
Dim strSQl As String
Dim MCID As Integer
Dim Check As String

'adds mailing group number to recordset

MCID = Forms!Mothers_Information!MCID
strSQl = "SELECT * FROM Type_of_Participant_Info WHERE MCID = " & MCID
Set dbThe_Mothers_Circle = CurrentDb()
Set rstType = dbjoi.OpenRecordset(strSQl, dbOpenDynaset)
With rstType
.AddNew
.Fields("MCID") = MCID
.Fields("TypeID") = X
.Update
End With
rstType.Close
End Function
RoyVidar wrote:
De********@aol.com wrote in message
<11**********************@z34g2000cwc.googlegroups .com> :
The above error occurs when I attempt to select any of the check boxes
that are within this code.

Private Sub Check39_AfterUpdate()
If Check39 = True Then
CheckboxTrue 1
Else: CheckboxFalse 1
End Sub

I am using Access 2003. I've tried everything I could think. Can anyone
help on this?

Thanks
Deenos


Do you have subs or functions called CheckboxFalse and CheckboxTrue
within the current scope?

--
Roy-Vidar


Apr 4 '06 #4
Thanks. It worked. I did not define it.
But now i am getting this error message that the database could not
find this form Mothers Information. The form name is spelt correctly
and does exist. Here is the code:

Public Function CheckBoxTrue(X As Integer)
Dim dbThe_Mothers_Circle As DAO.Database
Dim rstType As DAO.Recordset
Dim strSQl As String
Dim MCID As Integer
Dim Check As String

'adds mailing group number to recordset

MCID = Forms!Mothers_Information!MCID
strSQl = "SELECT * FROM Type_of_Participant_Info WHERE MCID = " & MCID
Set dbThe_Mothers_Circle = CurrentDb()
Set rstType = dbjoi.OpenRecordset(strSQl, dbOpenDynaset)
With rstType
.AddNew
.Fields("MCID") = MCID
.Fields("TypeID") = X
.Update
End With
rstType.Close
End Function

Apr 4 '06 #5
De********@aol.com wrote:
But now i am getting this error message that the database could not
find this form Mothers Information. The form name is spelt correctly
and does exist. Here is the code: Dim MCID As Integer MCID = Forms!Mothers_Information!MCID


It's never a great idea to have actual spaces in an object, such as a
form or a control (text box, check box, etc) name. That said, try this:

Forms("Mothers Information").MCID

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Apr 5 '06 #6
I am so rusty with this stuff it isn't funny. Where would you recommend
I go to learn ie. a school, Microsoft. I am in NY.

Apr 5 '06 #7
De********@aol.com wrote:
I am so rusty with this stuff it isn't funny. Where would you recommend
I go to learn ie. a school, Microsoft. I am in NY.


Depends on what your job is. I learned as I went, primarily by using
the help files (though these really, really suck in versions after
Access 97, which had an excellent help) and this newsgroup. Googling on
advanced google can help too, but there can be pitfalls if you pick an
out to lunch answer on a topic you're learning about. I would google
and confirm methods by asking here if you find multiple methods.

For google, see the current thread, "O.T. - Can I redownload a
particular thread I've deleted in Free Agent?" and fredG's first response.

A course could be a good idea to help you get started, for sure, but as
I am Newfoundland, Canada, I'm not familiar with NY state at all, sorry.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Apr 5 '06 #8
This is the way i've been approaching it myself. Thanks for all your
help. The problem was solved.

Best

Apr 5 '06 #9
This is the way i've been approaching it myself. Thanks for all your
help. The problem was solved.

Best

Apr 5 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Xiaofeng Zhang | last post by:
when I compile my project setting, there are many LINK errors. But when I compile my project under debug setting, everything is OK. How can I deal with it? The errors is followed. Linking......
17
by: newbiecpp | last post by:
I have hard time to understand run-time environment. Let assume that I have a program that has a simple variable alpha. When this variable is statically allocated, the compiler can use the...
10
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
12
by: JS | last post by:
I use winXP and have installed Cygwin. I use Dev-C++ and the Cygwin compiler, but for some reason I can't compile this code: #include <setjmp.h> #include <stdio.h> #include <stdlib.h> ...
8
by: mastermagrath | last post by:
Hi, I'm about half way through Bruce Eckels thinking in C++ Vol 1. He gives a very short example of how compiler function name decoration helps remove subtle bugs by type-safe linkage. However,...
5
by: Torben Laursen | last post by:
Hi Often I just want to compile one c++ file in a project the check it for errors. Now I can right click on a *.cpp file and select "Compile" But is there a way and short cut to compile a file...
5
by: wong_powah | last post by:
#include <vector> #include <iostream> using std::cout; using std::vector; enum {DATASIZE = 20}; typedef unsigned char data_t;
9
by: Jack | last post by:
#include "string.h" #include <iostream> using namespace std; int main() { char buf = "This is a test."; int len = 1024; bzero(buf, len); cout<<"buf::"<<buf<<endl; }
2
by: BruceWho | last post by:
I downloaded boost1.35.0 and built it with following command: bjam --toolset=msvc-7.1 --variant=release --threading=multi -- link=shared --with-system stage and it failed to compile, error...
2
myusernotyours
by: myusernotyours | last post by:
Hi All, Am working on a Java application in which I have to use the JNI to Interface with some native code for both windows and unix. Am using netbeans IDE with the C/C++ pack installed. Am also...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.