Tab Control Question

S

SITCFanTN

I have a tab control group named "tabResearch". The tabs on this form are
named "pageBalancing", "pageCheck" and "pageCreditCard". When the user
clicks on the "Check" tab, I want "Check" to prefill into the bound control
of "CaseType" in the table "tblQAData". I want this same type of action to
occur when tab "pageBalancing" is clicked...I want the word Balancing to
prifill into the bound control of "CaseType" in the "tblQAData" and when
"pageCreditCard" is clicked, I want "Credit Card to prefill. I'm not sure
how to code this so any help you can give is appreciated. thank you.
 
R

ruralguy via AccessMonster.com

Use code in the Change event of the Tab Control to assign the value to your
field.
 
S

SITCFanTN

I'm not sure how to do that, can you provide the code for one of the tabs and
then I'm sure I'll be able to do the rest of them. Is it an if/then
statement?

thanks
 
R

ruralguy via AccessMonster.com

Something like the following should do it.

Private Sub TabCtl2_Change()
On Error GoTo Err_TabCtl2_Change

Select Case Me.TabCtl2.value

Case 0
'-- The 1st Tab
Case 1
'-- The 2nd Tab
Case 2
'-- The 3rd Tab
Case Else
End Select

Exit_TabCtl2_Change:
Exit Sub

Err_TabCtl2_Change:
MsgBox "Error " & Err.Number & " - " & Err.Description
Resume Exit_TabCtl2_Change

End Sub

...using your control names of course.

I'm not sure how to do that, can you provide the code for one of the tabs and
then I'm sure I'll be able to do the rest of them. Is it an if/then
statement?

thanks
Use code in the Change event of the Tab Control to assign the value to your
field.
[quoted text clipped - 7 lines]
 
S

SITCFanTN

I'm pretty new at this and am not understanding this code at all. Where am I
assigning the casetypeID...I just don't see it. The tab name should be the
casetypeID field in the table but I don't see where I am calling the table
name either. Can you explain the code. I'm trying to edit it to my
situation and it is not working.

ruralguy via AccessMonster.com said:
Something like the following should do it.

Private Sub TabCtl2_Change()
On Error GoTo Err_TabCtl2_Change

Select Case Me.TabCtl2.value

Case 0
'-- The 1st Tab
Case 1
'-- The 2nd Tab
Case 2
'-- The 3rd Tab
Case Else
End Select

Exit_TabCtl2_Change:
Exit Sub

Err_TabCtl2_Change:
MsgBox "Error " & Err.Number & " - " & Err.Description
Resume Exit_TabCtl2_Change

End Sub

...using your control names of course.

I'm not sure how to do that, can you provide the code for one of the tabs and
then I'm sure I'll be able to do the rest of them. Is it an if/then
statement?

thanks
Use code in the Change event of the Tab Control to assign the value to your
field.
[quoted text clipped - 7 lines]
"pageCreditCard" is clicked, I want "Credit Card to prefill. I'm not sure
how to code this so any help you can give is appreciated. thank you.

--
RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
 
R

ruralguy via AccessMonster.com

Does each tab have a SubForm on it? What is the RecordSource of the form?
I'm pretty new at this and am not understanding this code at all. Where am I
assigning the casetypeID...I just don't see it. The tab name should be the
casetypeID field in the table but I don't see where I am calling the table
name either. Can you explain the code. I'm trying to edit it to my
situation and it is not working.
Something like the following should do it.
[quoted text clipped - 34 lines]
 
P

ploddinggaltn

The table is TBLQAData, the record source is tblTasks. In my tblTasks, the
field names are Primary Key TaskID and are numeric values of 1, 2, 3, 4 and
then the next field is used for my drop down box and that is TaskName. On my
form I have a dropdown field to select a task from the table. I'd like to
delete the drop down entirely and capture the TaskID when the tab is clicked
Does each tab have a SubForm on it? What is the RecordSource of the form?
I'm pretty new at this and am not understanding this code at all. Where am I
assigning the casetypeID...I just don't see it. The tab name should be the
casetypeID field in the table but I don't see where I am calling the table
name either. Can you explain the code. I'm trying to edit it to my
situation and it is not working.
Something like the following should do it.
[quoted text clipped - 34 lines]
"pageCreditCard" is clicked, I want "Credit Card to prefill. I'm not sure
how to code this so any help you can give is appreciated. thank you.
 
R

ruralguy via AccessMonster.com

If the fields you want to change are not in the RecordSource of the form then
it would take an update query to alter the table. a Tab control is *not* a
SubForm and does not affect referencong controls is any way. It is as if the
TabControl was not even there.
The table is TBLQAData, the record source is tblTasks. In my tblTasks, the
field names are Primary Key TaskID and are numeric values of 1, 2, 3, 4 and
then the next field is used for my drop down box and that is TaskName. On my
form I have a dropdown field to select a task from the table. I'd like to
delete the drop down entirely and capture the TaskID when the tab is clicked
on the tab control form....by the way, is a tab control considered a sub
form? I truly appreciate your patience and help, thank you.
Does each tab have a SubForm on it? What is the RecordSource of the form?
[quoted text clipped - 9 lines]
 

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


Top