Conditional Form Sections?

fatmcgav

Registered User.
Local time
Today, 07:26
Joined
Jul 24, 2003
Messages
32
Hi there,

I'm trying to do a new membership database for a local group who take monetary subscriptions.
Basically, there's a form for creating a new member, with a few tabs - Contact Info, Payment Info, and one other.

Basically, in the payment tab, i've got a dropo down box to select the individual package from a packages table, another to select the payment term (Monthly, Annually), and a final one to select the payment method.
Now in there i've got a list of possible payment methods: Cash, Cheque, Credit/Debit Card, Direct Debit.
Now obviouslly, each payment method is going to have different requirememnts for what info the club actually needs. Cash simply needs amount of payment and date of payment. Cheque needs payment amount, payment date, cheque details. Card is obviously going to need the CC number, Valid & Expiry Date, Card Type, CCV Number, etc.

So basically, i want to be able to have the relevant section display when that payment method is selected from the Payment Method drop-down box.
What's the easiet way of doing this? Could i create another tab-set inside the payment tab, and then only display the one tab relevant to the selected method?

Cheers
Fatmcgav
 
The way I would do it is to hide and unhide controls based on the selected method.
 
Ok, just managed to get back to work on this.

I've managed to hide and unhide the whole TabControl, but i cant find out to show individual pages.

Eg: There is a drop-down box on the form called page, which has the AfterUpdate property set to change the tabcontrol.

I can show the entire control, but what i want to be able to do is if the DropDown is "One", then show TabPage1, "Two" show's TabPage2, etc.

Now i've tried several code lines to show the individual pages, but i cant seem to find one that works. The code that i've got atm is below.

Any ideas?

Cheers
Gavin

Code:
Private Sub Page_AfterUpdate()

If Forms![tabtest]![Page] = "One" Then
Forms![tabtest]![Test].Visible = True
[COLOR=Red]{Page Show Code goes here}[/COLOR]

ElseIf Forms![tabtest]![Page] = "Two" Then
Forms![tabtest]![Test].Visible = True
[COLOR=Red]{Page Show Code goes here}[/COLOR]

ElseIf Forms![tabtest]![Page] = "Three" Then
Forms![tabtest]![Test].Visible = True
[COLOR=Red]{Page Show Code goes here}[/COLOR]

End If


End Sub
 
I would use a Select Case

SELECT CASE Me.Page

CASE "One"
Me.page1.Visible = True

CASE "Two
Me.Page2.visible = True

etc.

END SELECT

Each page on the table control is a separate control but grouped together. But you address each page separately. So the syntax is Me.pagename.Visible.
 
Right, where abouts does this go, as i tried putting it in the afterupdate property of the drop-down box, and it doesnt seem to work.

Any help appreicated.

Cheers
Gavin
 
It should work in the After Update event of the Page control.
 

Users who are viewing this thread

Back
Top Bottom