473,396 Members | 1,816 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,396 software developers and data experts.

Unknown Problem from a beginner

12
In my database, I want to let it calculate some equations when I press a button. However when I do press the button, it states "Compile error: Method or data member not found". It highlights "Private Sub Command49_Click()" in yellow and ".P1Score" in blue. What does this mean?
The problem only arised when I added the section of P1 to P10 on. It was working fine before with just the S1 to S5. Does this mean that I don't have an object named P1Score while I have an object for S1Score? How do I find out what is S1Score in design view? Is there a find option or something?
I know that when I type "Me." it shows up a list and it is S1Score to S5Score but no PxScore. How do I fix this?
Is it something to do with AccessField? If so, what is it and how do I set P1Score as an accessfield?
Thank you in advance for your help and assistance! I've attached the code below. If you need more info to answer this question, please inform me. Thank you!

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command49_Click()
  2.  
  3.     answered = checkAllAnswered()
  4.  
  5.     If answered = False Then
  6.         Exit Sub
  7.     End If
  8.  
  9.     S1 = IIf(IsNull(Me.S1Score) Or Me.S1Score = 0, 1, CInt(Me.S1Score))
  10.     S2 = IIf(IsNull(Me.S2Score) Or Me.S2Score = 0, 1, CInt(Me.S2Score))
  11.     S3 = IIf(IsNull(Me.S3Score) Or Me.S3Score = 0, 1, CInt(Me.S3Score))
  12.     S4 = IIf(IsNull(Me.S4Score) Or Me.S4Score = 0, 1, CInt(Me.S4Score))
  13.     S5 = IIf(IsNull(Me.S5Score) Or Me.S5Score = 0, 1, CInt(Me.S5Score))
  14.     P1 = IIf(IsNull(Me.P1Score) Or Me.P1Score = 0, 1, CInt(Me.P1Score))
  15.     P2 = IIf(IsNull(Me.P2Score) Or Me.P2Score = 0, 1, CInt(Me.P2Score))
  16.     P3 = IIf(IsNull(Me.P3Score) Or Me.P3Score = 0, 1, CInt(Me.P3Score))
  17.     P4 = IIf(IsNull(Me.P4Score) Or Me.P4Score = 0, 1, CInt(Me.P4Score))
  18.     P5 = IIf(IsNull(Me.P5Score) Or Me.P5Score = 0, 1, CInt(Me.P5Score))
  19.     P6 = IIf(IsNull(Me.P6Score) Or Me.P6Score = 0, 1, CInt(Me.P6Score))
  20.     P7 = IIf(IsNull(Me.P7Score) Or Me.P7Score = 0, 1, CInt(Me.P7Score))
  21.     P8 = IIf(IsNull(Me.P8Score) Or Me.P8Score = 0, 1, CInt(Me.P8Score))
  22.     P9 = IIf(IsNull(Me.P9Score) Or Me.P9Score = 0, 1, CInt(Me.P9Score))
  23.     P10 = IIf(IsNull(Me.P10Score) Or Me.P10Score = 0, 1, CInt(Me.P10Score))
Dec 7 '07 #1
5 1279
JustJim
407 Expert 256MB
In my database, I want to let it calculate some equations when I press a button. However when I do press the button, it states "Compile error: Method or data member not found". It highlights "Private Sub Command49_Click()" in yellow and ".P1Score" in blue. What does this mean?
The problem only arised when I added the section of P1 to P10 on. It was working fine before with just the S1 to S5. Does this mean that I don't have an object named P1Score while I have an object for S1Score? How do I find out what is S1Score in design view? Is there a find option or something?
I know that when I type "Me." it shows up a list and it is S1Score to S5Score but no PxScore. How do I fix this?
Is it something to do with AccessField? If so, what is it and how do I set P1Score as an accessfield?
Thank you in advance for your help and assistance! I've attached the code below. If you need more info to answer this question, please inform me. Thank you!
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command49_Click()
  2.  
  3.     answered = checkAllAnswered()
  4.  
  5.     If answered = False Then
  6.         Exit Sub
  7.     End If
  8.  
  9.     S1 = IIf(IsNull(Me.S1Score) Or Me.S1Score = 0, 1, CInt(Me.S1Score))
  10.     S2 = IIf(IsNull(Me.S2Score) Or Me.S2Score = 0, 1, CInt(Me.S2Score))
  11.     S3 = IIf(IsNull(Me.S3Score) Or Me.S3Score = 0, 1, CInt(Me.S3Score))
  12.     S4 = IIf(IsNull(Me.S4Score) Or Me.S4Score = 0, 1, CInt(Me.S4Score))
  13.     S5 = IIf(IsNull(Me.S5Score) Or Me.S5Score = 0, 1, CInt(Me.S5Score))
  14.     P1 = IIf(IsNull(Me.P1Score) Or Me.P1Score = 0, 1, CInt(Me.P1Score))
  15.     P2 = IIf(IsNull(Me.P2Score) Or Me.P2Score = 0, 1, CInt(Me.P2Score))
  16.     P3 = IIf(IsNull(Me.P3Score) Or Me.P3Score = 0, 1, CInt(Me.P3Score))
  17.     P4 = IIf(IsNull(Me.P4Score) Or Me.P4Score = 0, 1, CInt(Me.P4Score))
  18.     P5 = IIf(IsNull(Me.P5Score) Or Me.P5Score = 0, 1, CInt(Me.P5Score))
  19.     P6 = IIf(IsNull(Me.P6Score) Or Me.P6Score = 0, 1, CInt(Me.P6Score))
  20.     P7 = IIf(IsNull(Me.P7Score) Or Me.P7Score = 0, 1, CInt(Me.P7Score))
  21.     P8 = IIf(IsNull(Me.P8Score) Or Me.P8Score = 0, 1, CInt(Me.P8Score))
  22.     P9 = IIf(IsNull(Me.P9Score) Or Me.P9Score = 0, 1, CInt(Me.P9Score))
  23.     P10 = IIf(IsNull(Me.P10Score) Or Me.P10Score = 0, 1, CInt(Me.P10Score))
Hi,
It seems to me that you must have controls on your form (the one where Command49 is) has controls called S1Score etc but there is no controls called PxScore. It may be that they are called TextPxScore or some other default Access name. You have two choices, change the code to match the control names or change the control names to match the code.

Jim

ps. A thread title more indicitave of your problem would help!
JJ
Dec 7 '07 #2
HotKgon
12
Hi,
It seems to me that you must have controls on your form (the one where Command49 is) has controls called S1Score etc but there is no controls called PxScore. It may be that they are called TextPxScore or some other default Access name. You have two choices, change the code to match the control names or change the control names to match the code.

Jim

ps. A thread title more indicitave of your problem would help!
JJ
Is a control an object that you put on in design view? if so, I don't know where S1Score control is.... I'm trying to extend an existing database so I don't actually know what S1Score.
I have 5 tick boxes which are in a frame. And the control source is from a table with the column S1Score. I replicated this frame and changed the control source to P1Score. I also copied all the coding which is associated with S1Score and renamed it to be P1Score. Yet it still doesn't work. I don't know what the S1Score control is so therefore I can't make a P1Score control to replicate it. Is there a way to find the S1Score control in design view?

BTW, are controls the things which pop down in a list after you type the dot for "Me."?

I also looked into the object browser and search for S1Score. It came back that S1Score is a member to 5 different classes (all forms). I did the same for P1Score and it was only a member of 1 class. How do I add P1Score as a member for the other classes which S1Score is a member of?

I really have no clue in access so I have no idea what a control and things are. Sorry about the inconvience!

JJ, Thank you very much for you reply!

-HotKgon
Dec 7 '07 #3
JustJim
407 Expert 256MB
Is a control an object that you put on in design view? if so, I don't know where S1Score control is.... I'm trying to extend an existing database so I don't actually know what S1Score.
I have 5 tick boxes which are in a frame. And the control source is from a table with the column S1Score. I replicated this frame and changed the control source to P1Score. I also copied all the coding which is associated with S1Score and renamed it to be P1Score. Yet it still doesn't work. I don't know what the S1Score control is so therefore I can't make a P1Score control to replicate it. Is there a way to find the S1Score control in design view?

BTW, are controls the things which pop down in a list after you type the dot for "Me."?

I also looked into the object browser and search for S1Score. It came back that S1Score is a member to 5 different classes (all forms). I did the same for P1Score and it was only a member of 1 class. How do I add P1Score as a member for the other classes which S1Score is a member of?

I really have no clue in access so I have no idea what a control and things are. Sorry about the inconvience!

JJ, Thank you very much for you reply!

-HotKgon
Well HotKgon, you have been dropped in it right royally haven't you?

Make a copy of the database application using Windows Explorer so we don't break the first one. Not likely, but why take the risk, you should always work on a development version, not the working one.

You need to look at the table (in design view) which has S1Score in it. Try to figure out what (if any) are the differences in the SxScore fields. Then you need to add a new field for each PxScore (P1Score, P2Score etc) and save the table.

Now go to your form and, with the wizard button pressed on the toolbox, add an option group. See how you go from there. You might want to delete the original option group first and just add one with all the score fields in it at once.

Once you've got it working, either do it all again in the real application (good practice) or rename the table and form in the real application and import both the new table and new form from the development app.

Have fun and 'AveAGoodWeekend

Jim

ps after you type Me. you get offerred the whole gamut of things from Methods, Objects, Properties. This will include controls on your form and is a very, very good reson for adopting a naming convention such as prefixing all text boxes with txt so that they group together when you are in this list.
Dec 7 '07 #4
HotKgon
12
thank you once again JJ. I found out that if I click on "add existing fields", put PxScore and made it invisible. It ends up working!
Dec 8 '07 #5
JustJim
407 Expert 256MB
thank you once again JJ. I found out that if I click on "add existing fields", put PxScore and made it invisible. It ends up working!
Good one.

Jim




(message too short my armpit!)
Dec 9 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Robert | last post by:
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani <manish.j@gmx.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;...
2
by: Amy | last post by:
This is what I want to do: 1. Delete all tables in database with table names that ends with a number. 2. Leave all other tables in tact. 3. Table names are unknown. 4. Numbers attached to...
1
by: imw8n4u | last post by:
I need to create combo box that lists unique values from a table and limit the selection to this list. However, I also need to add "UNKNOWN" as a valid selection even though it is not in the table...
5
by: Lars-Erik Aabech | last post by:
Hi! Guess it's my day again.. Tried to deploy a test release of a new asp.net web today, and got a terrible error. The web is running swell on three development computers, but when it's copied...
17
by: Barret Bonden | last post by:
As an old programmer just now looking at VB.net I have a question: How does one simply open one form from another ? I don't mean how does one create a new instance of that form , but rather how...
9
by: Klaus Johannes Rusch | last post by:
IE7 returns "unknown" instead of "undefined" when querying the type of an unknown property of an object, for example document.write(typeof window.missingproperty); Has "unknown" been defined...
5
by: fjanon | last post by:
Hi, I went through the HTML spec without finding the description of what the browsers behavior should/must be regarding tags or attributes they don't understand. I did a quick experiment like...
1
by: tactech | last post by:
Hello Can somebody help me and tell me why I can’t change the background color of the second PN2 panel. I get this error about unknown source Exception in thread "AWT-EventQueue-1"...
2
by: Calvin Cheng | last post by:
Hi, I am attempting to convert a bunch of .txt files into html using the docutils package. It works for most of the txt files except for the index.txt file which gives 2 errors: (1)...
4
by: omono84 | last post by:
I know that this should be rather simple but i seem to be missing a step to get it to work. and have been unable to find a solution on the net. The aim is that I click on the open button to find...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.