Option Group Woes!!! (1 Viewer)

pcdummy

Registered User.
Local time
Today, 13:49
Joined
May 9, 2001
Messages
45
Ok Let me try to explain my dilemma.

Am trying to construct new db, where customers can by individually or jointly.

Have a orders form where when you enter the customer information, you can use an option group to choose "individual" or "joint" purchase. i would like the CO Buyer Fields and labels to not be visible until the "joint" option is enabled, can someone explain the easiest way to do this.

Have tried the following:

If Frame1.Value = 2 Then

Me.lblJointBuyerName.Visible = True
'etc, etc
Else Me.lblJointBuyerName.Visible = False

End If

Aso have the "joint" buyer text fields and lables as visible = no in form properties, since default will be individual purhcase..
Hope this is clear enough..

Thanks in advance

Jeff
 

Fornatian

Dim Person
Local time
Today, 13:49
Joined
Sep 1, 2000
Messages
1,396
Seems to me that:

1. The fields should be invisible by default - when entering a new record or when moving to a record where the option group value is 2.

2. The fields should be visible only when the option is selected OR you move to a record where the option has previously been chosen.

Therefore:

1.Set the default properties of the controls to invisible.

2. Put the code you already have behind both the Current event and the click event of the frame.

3. You may need to expand the code to deal with the situation where someone originally decides its a group purchase and then reverts to an individual purchase - on these occassions you'll want to clear the fields to avoid confusion.

The code you need(I think) is:

If Me!FrameName = 2 Then 'group purchase
Me.GroupPurchaseControl.Visible = True
'repeat for other controls
Else
Me.GroupPurchaseControl.Visible = False
'repeat for other controls
End if

'You'll need to put the else in so that when the user scrolls between records the fields shown will correspond with the purchase option.

Behind the frame code you may also want to add something like this to clear the group info if it is there:

If Me!FrameName = 1 Then 'purchase by individual
If Me!GroupControl1 <>"" or Me!GroupControl2 <>"" etc... Then
If Msgbox("Do you want to clear the co-buyers info?,vbyesno,"App Title") = vbYes then
Me.GroupControl1 = ""
Me.GroupControl2 = ""
Else
'must be a group purchase therefore change the purchase type frame back again
Me!FrameName = 2
End if
End if
End if
 

pcdummy

Registered User.
Local time
Today, 13:49
Joined
May 9, 2001
Messages
45
Thank you very much, I will try as you suggested, will post results. Once again, thank you for taking the time to reply to my post. Very much appreciated.

Best Regards,

Jeff
 

pcdummy

Registered User.
Local time
Today, 13:49
Joined
May 9, 2001
Messages
45
Thanks guys. Tried both ways. Both worked. Decided to go with Fornation's suggestion in the end. However, thanks to everyone for the help


Jeff
 

Users who are viewing this thread

Top Bottom