A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

"Option Group" revisited



 
 
Thread Tools Display Modes
  #1  
Old October 31st, 2004, 12:21 AM
Stephanie
external usenet poster
 
Posts: n/a
Default "Option Group" revisited

Hi. MVP Graham helped me with the first part of my "option
group" issue- I now have two option buttons: Member
(option1) and Affiliate(option2) Each are yes/no fields,
with an option group container, and code:
Option1_Click
Me!Option2 = Not Me!Option1
Option2_Click
Me!Option1 = Not Me!Option2.

If someone is a Member, I want MemberDate field required
and AffiliateDate non-enterable. If someone is an
Affiliate, I want AffiliateDate field requried and
MemberDate non-enterable. MemberDate and AffiliateDate
are Date/Time fields. Any suggestions? Thanks! Stephanie
  #2  
Old October 31st, 2004, 08:47 AM
Brett Collings [429338]
external usenet poster
 
Posts: n/a
Default

It's late Sunday night so this is "air code" ... E & OE .. ok

If Option1 Then
AffiliateDateNAME.Enabled = False
AffiliateDateNAME.Locked = True

I have emphasised NAME like that because the Name of a control is what
Access refers to, not to the field name inside it. For this reason,
when both are the same (which is the MS default) Access gets confused
and you get odd results or the code doesn't work at all.

For this reason, all controls on a form ought to be manually renamed
using a Naming Convention that makes a distinction between the Name
(Design View-Properties-Other-Name) and the ControlSource. we
generally use txt, num, dte, cbo, opt, cmd, lbl as the main ones.

Using num for numerical fields is not entirely kosher as in a high
level multi-developer environment, one should be explicit with lng,
dbl, sgl, pct, cur etc but we find this is mostly just an overkill in
an Access database. Perhaps our way is just a little lazy, I don't
know, it works for us ok.

Brett

On Sat, 30 Oct 2004 16:21:37 -0700, "Stephanie"
wrote:

Hi. MVP Graham helped me with the first part of my "option
group" issue- I now have two option buttons: Member
(option1) and Affiliate(option2) Each are yes/no fields,
with an option group container, and code:
Option1_Click
Me!Option2 = Not Me!Option1
Option2_Click
Me!Option1 = Not Me!Option2.

If someone is a Member, I want MemberDate field required
and AffiliateDate non-enterable. If someone is an
Affiliate, I want AffiliateDate field requried and
MemberDate non-enterable. MemberDate and AffiliateDate
are Date/Time fields. Any suggestions? Thanks! Stephanie


Cheers,
Brett

----------------------------------------------
Be adventurous, be bold, be careful, be a star
----------------------------------------------
Brett Collings
Business & Systems Analyst
Management Information Systems Developer
  #3  
Old October 31st, 2004, 07:58 PM
Stephanie
external usenet poster
 
Posts: n/a
Default

Brett,
Thanks for the reply and Happy Halloween!
Thanks for the control naming lesson- I appreciate it. I'm
sure my database and field names scare the professionals.

I'm still a bit confused with the code. What field would
I attach it to and to which event?
Seems as though I'd attach the code to be somehow
associated with the Member field so that the
AffiliateDateName field is disabled, and that the trigger
needs to happen after the Member field is populated. I
tried to embed it along wiht the Option1_Click() code, but
it didn't work correctly. Events and coding are a
struggle for me. Thanks and what are you doing writing
air code at 2 AM anyway? Stephanie

-----Original Message-----
It's late Sunday night so this is "air code" ... E &

OE .. ok

If Option1 Then
AffiliateDateNAME.Enabled = False
AffiliateDateNAME.Locked = True

I have emphasised NAME like that because the Name of a

control is what
Access refers to, not to the field name inside it. For

this reason,
when both are the same (which is the MS default) Access

gets confused
and you get odd results or the code doesn't work at all.

For this reason, all controls on a form ought to be

manually renamed
using a Naming Convention that makes a distinction

between the Name
(Design View-Properties-Other-Name) and the

ControlSource. we
generally use txt, num, dte, cbo, opt, cmd, lbl as the

main ones.

Using num for numerical fields is not entirely kosher as

in a high
level multi-developer environment, one should be explicit

with lng,
dbl, sgl, pct, cur etc but we find this is mostly just an

overkill in
an Access database. Perhaps our way is just a little

lazy, I don't
know, it works for us ok.

Brett

On Sat, 30 Oct 2004 16:21:37 -0700, "Stephanie"
wrote:

Hi. MVP Graham helped me with the first part of

my "option
group" issue- I now have two option buttons: Member
(option1) and Affiliate(option2) Each are yes/no

fields,
with an option group container, and code:
Option1_Click
Me!Option2 = Not Me!Option1
Option2_Click
Me!Option1 = Not Me!Option2.

If someone is a Member, I want MemberDate field required
and AffiliateDate non-enterable. If someone is an
Affiliate, I want AffiliateDate field requried and
MemberDate non-enterable. MemberDate and AffiliateDate
are Date/Time fields. Any suggestions? Thanks!

Stephanie

Cheers,
Brett

----------------------------------------------
Be adventurous, be bold, be careful, be a star
----------------------------------------------
Brett Collings
Business & Systems Analyst
Management Information Systems Developer
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Option Group to Preview/Print Reports Tia Using Forms 1 August 16th, 2004 02:17 AM
Unbound option group writing text values... Davie P Using Forms 5 August 12th, 2004 03:49 PM
Autofill an option group based on a date field. Tara Using Forms 1 July 29th, 2004 09:22 PM
option group troy Using Forms 4 June 23rd, 2004 11:51 PM
Like Option group Matt Using Forms 0 May 25th, 2004 08:16 PM


All times are GMT +1. The time now is 03:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.