Which the control of the page in Form?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

I have a F_MainForm with pages, with one subform for page: SubF_A.Name,
SubF_B.Name, ...
I would like to show in textbox, in F_MainForm, the clicked subform page name.
Is it possible in Access2k, please.
Thanks in advance.
an
 
Use the Change event of the tab control to compare its Value to the
PageIndex of the various pages, in a Select Case, and assign the name to the
unbound text box.
 
Thank you for the reply.
Excuse my ignorance, but as I make this, please.
an
 
Sorry.
I writed:

Private Sub TabCtl17_Change()

Select Case txtTextBoxName

PageIndex0 = "Page1"
PageIndex1 = "Page2"
PageIndex2 = "Page3"
...
End Select
End Sub

(Return compile error: Statments and labels invalid between Select Case and
first Case)

Thanks more one time.
an
 
The syntax for Select Case is:

Select Case testexpression
[Case expressionlist-n
[statements-n]] ...
[Case Else
[elsestatements]]
End Select

For example:

Select Case performance
Case 1
Bonus = salary * 0.1
Case 2, 3
Bonus = salary * 0.09
Case 4 To 6
Bonus = salary * 0.07
Case Is > 8
Bonus = 100
Case Else
Bonus = 0
End Select
 
Thanks for your reply.

Sorry but... I continue don't to apply to my situation (?)
an

Douglas J. Steele said:
The syntax for Select Case is:

Select Case testexpression
[Case expressionlist-n
[statements-n]] ...
[Case Else
[elsestatements]]
End Select

For example:

Select Case performance
Case 1
Bonus = salary * 0.1
Case 2, 3
Bonus = salary * 0.09
Case 4 To 6
Bonus = salary * 0.07
Case Is > 8
Bonus = 100
Case Else
Bonus = 0
End Select


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


an said:
Sorry.
I writed:

Private Sub TabCtl17_Change()

Select Case txtTextBoxName

PageIndex0 = "Page1"
PageIndex1 = "Page2"
PageIndex2 = "Page3"
...
End Select
End Sub

(Return compile error: Statments and labels invalid between Select Case
and
first Case)

Thanks more one time.
an
 
The code will look something like this example, where:
- tabMain is the name of the tab control;
- text1 is the name of the unbound text box to show the result;
- the first page is named pgeBio, and the 2nd is pgeAddress.

Private Sub tabMain_Change()
Select Case Me.tabMain.Value
Case Me.pgeBio.PageIndex
Me.text1 = "Biographical page"
Case Me.pgeAddress.PageIndex
Me.text1 = "Addresses page"
Case Else
Me.text1 = "Huh?"
End Select
End Sub

You will need some experience with VBA code to apply this to your situation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

#Error. Why, please? 2
Send to table 6
Sintax to DSUM (?) 2
conditional tab page 1
mirror data from subform to main form 3
Adding new page to tab control crash 3
Month day versus week day 5
Link subform ID control 3

Back
Top