Jumat, 03 Oktober 2014

Re: [MS_AccessPros] Re: option group error message

 

Hi Jessica,

great!

adding on to what Duane said ...

> "what is the significance of Me. when naming controls?   

none -- when NAMING.  When referring to controls, however, you need to preface the controlname with where the control is.  If you are in code behind the form where the control id displayed, you can skip the forms!Formname stuff and simply say Me.  Hence:

me.controlname
refers to a control named controlname on the form that the code is behind.

a nice thing about typing "me." in code is that intellisense kicks and and prompts you with most of the things you can choose

> " get all of the information on one form? "

perhaps you should rethink your display ... if the form is too long for the screen, perhaps pages would be easier to navigate and work better with Access

> "still keep all of the fields in the same table "

if your table has more than about 15-20 fields and is not an exceptional table that needs to store point-in-time information such as invoices, perhaps you should (re-)think your structure.  There are some videos on planning a database in the beginning of this playlist that would be beneficial for you to watch:

Learn Access Playlist on YouTube

 


Warm Regards,
Crystal

 *
   (: have an awesome day :)
 *


On Friday, October 3, 2014 4:23 PM, "'Bill Mosca' wrmosca@comcast.net [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:




Hi Jessica
 
You should never name controls using Me. The "Me" is just a way to further identify a control, method or property of the form and to force Intellisense to automatically open a context menu in the code window so you can easily select those things.
 
If you can't fit all your fields on a form your tables are not normalized. Read Crystal's free eBook "Access Basics". You can download it from my site ThatllDoIT.com
 
Regards,
Bill Mosca,
Founder, MS_Access_Professionals
That'll do IT http://thatlldoit.com
MS Access MVP
http://mvp.microsoft.com/en-us/mvp/Bill%20Mosca-35852
My Nothing-to-do-with Access blog
 
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Friday, October 03, 2014 2:18 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] Re: option group error message
 
 
Thanks everyone.  I got it fixed.  Apparently I had a problem in my table so I deleted the problem field and created a completely new one and it's fine now.   I will rename my frames from here on out which leads to another stupid question:  what is the significance of Me. when naming controls?  
 
And another question: Apparently I won't be able to make my form long enough to include all of the fields I will need.  Is a subform the best (AKA: easiest) way to get all of the information on one form?  If so, can I still keep all of the fields in the same table or should there be a different table for each form?  I'm hoping to keep this as simple as possible since I have only a basic understanding of Access.
 
Thanks,
Jessica
 

 
Hi Jessica,
 
it is a good idea to RENAME controls before adding code to them.  Instead of 'Frame332', name the control something like 'framePsych'
 
What if the control has no value yet?
 
If IsNull(me.framePsych) then exit sub
or
Select Case nz(me.framePsych,2)  'assume No is the default value
 
~~~
 
for fields that have a Yes/No answer, I would recommend storing as Yes/No data type or Integer data type.  If you set to Yes/No, you can set the display to Yes/No instead of True/False.  Then you could make your option values -1 and 0 to correspond to the numeric values for True and False so you do not even need code.
 
Warm Regards,
Crystal
 
 *
   (: have an awesome day :)
 *
 
 
 
On Wednesday, October 1, 2014 3:57 PM, "Duane Hookom duanehookom@... [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:
 
 
When I click reply from outlook.com, the previous information from the thread is automatically included so it is the default for me ;-)
 
There are some tips about how to debug code at http://www.tek-tips.com/faqs.cfm?fid=7148.
 
It would be interesting to find out which line causes the error message. What happens if you add a new, blank text box (nothing in the control source) to your form named "txtMyNewControl" and then changed your code to:
 
Private Sub Frame332_AfterUpdate()
  Select Case Frame332.Value
     Case 1
       Me.txtMyNewControl = "Yes"     'Psych.Value = "Yes"
     Case 2
        Me.txtMyNewControl = "No"      'Psych.Value = "No"
  End Select
End Sub
 
This might narrow down your problem to see if the value of Psych can be set or not.
 
Duane Hookom, MVP
MS Access
 
To: MS_Access_Professionals@yahoogroups.com
From: MS_Access_Professionals@yahoogroups.com
Date: Wed, 1 Oct 2014 14:11:41 -0700
Subject: [MS_AccessPros] Re: option group error message



Now I don't even know if i pushing the correct reply button.  I apologize if you don't have the message history, I have it so I'm assuming you do.
 
"Psych" is a unique name for the text box which has as it's control source a text field.  I try very hard to give everything a unique name so I can tell what I'm working with - probably no one else can tell what I'm doing but it works for me.  I am certain I am refering to the right text box in my code.  I don't know all of the lingo - I am extremely new to Access and I don't have anyone to consult with but all of you (my IT dept dislikes Access).  
 
Just in case I didn't reply correctly:
 
Private Sub Frame332_AfterUpdate()
Select Case Frame332.Value
Case 1
Psych.Value = "Yes"
Case 2
Psych.Value = "No"
End Select
End Sub

 
Thanks!
Jessica

 
 




__._,_.___

Posted by: Crystal <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (13)

.

__,_._,___

Tidak ada komentar:

Posting Komentar