Rabu, 01 Oktober 2014

RE: [MS_AccessPros] option group error message

 

Jessica,
 
I typically use Me. to reference any controls in the form. It makes it easier for my often confused mind.
 
Private Sub Frame332_AfterUpdate()
   Select Case Me.Frame332.Value
     Case 1
          Me.Psych.Value = "Yes"
     Case 2
          Me.Psych.Value = "No"
  End Select
End Sub
 
The code assumes Me.Psych is a text field/control in your form.
 
If Psych is a field name it looks like you are storing data values in field names which is typically not adviseable. I'll hold judgement since it's an assumption on my part.
 
Duane Hookom MVP
MS Access

 

To: MS_Access_Professionals@yahoogroups.com
From: MS_Access_Professionals@yahoogroups.com
Date: Wed, 1 Oct 2014 12:28:44 -0700
Subject: [MS_AccessPros] option group error message
 I have added several option groups to a form and have written the code to "translate" the option value from a number value to yes, no, n/a or whatever the case may be.  This has been working very well until now.  One option group is giving me " Run-time error '3032' Cannot perform this operation".  Here's the code:
 
Private Sub Frame332_AfterUpdate()
Select Case Frame332.Value
    Case 1
        Psych.Value = "Yes"
    Case 2
        Psych.Value = "No"
End Select
End Sub
 
This looks identical (with the exception of the field name of course) to all of the other option groups I have.  Can anyone see my problem?
 
Thanks!
Jessica


__._,_.___

Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar