Combo box functionality in tab pages

G

Guest

I have created an unbound combo box that when placed on a form takes me to
records specified. Works great, however I have created a tab with three
pages and the control shows up on each of the pages. I want it to show up on
only one of the tabs, so I have:
1. Copied the control to the page of the tab -- shows up only on the
specified page, but doesn't select the records. Code under event is exactly
the same.
2. Recreated the control from scratch on the tab page -- shows up only on
the specified page, but doesn't select the records. Code under event is
exactly the same.

Question -- for some bizarre reason can I not do this on a tab page?

I have searched the existing posts with language that I thought would hit
this problem, but came up blank.

Any help will be greatly appreciated.

Rick
 
R

Rick Brandt

HMBRick said:
I have created an unbound combo box that when placed on a form takes
me to records specified. Works great, however I have created a tab
with three pages and the control shows up on each of the pages. I
want it to show up on only one of the tabs, so I have:
1. Copied the control to the page of the tab -- shows up only on the
specified page, but doesn't select the records. Code under event is
exactly the same.
2. Recreated the control from scratch on the tab page -- shows up
only on the specified page, but doesn't select the records. Code
under event is exactly the same.

Question -- for some bizarre reason can I not do this on a tab page?

I have searched the existing posts with language that I thought would
hit this problem, but came up blank.

Any help will be greatly appreciated.

Rick

Do you have a SubForm on that TabPage? If so, are you expecting the
navigation to occur in the SubForm? Because it won't unless you add the
ComboBox to the SubForm itself.
 
G

Guest

No, I haven't added a subform. Is it an issue that the combo box is on the
tab, and attempting to navigate the larger form?

Rick
 
R

Rick Brandt

HMBRick said:
No, I haven't added a subform. Is it an issue that the combo box is
on the tab, and attempting to navigate the larger form?

No, that shouldn't make any difference. How are you determining that the
form is not navigating? Are you looking at the Record Number in the
Navigation Bar? Are you sure that the ComboBox still has "[Event
Procedure]" entered in the AfterUpdate event property? Cutting and Pasting
will usually cause you to lose that and then the code (while still present)
never actually runs.

Otherwise, post the code behind your ComboBox.
 
G

Guest

The combo box acts to present a record that has a field that matches the
selection. I always test by selecting a mismatching choice in the combo box.

I'll copy the code below. This is from the box that works when located on
the general form. When I place the combo box on the first tab page I can
make a combo box selection, but it doesn't drive the navigation to the
correct record. And yes, I always have to go and select [Event Procedure]
after copy/paste, and I confirmed that that was done.

Does the tab page act as a subform? If so, can you be specific about what
code modifications I'd have to make?

Thanks,

Rick

Rick Brandt said:
HMBRick said:
No, I haven't added a subform. Is it an issue that the combo box is
on the tab, and attempting to navigate the larger form?

No, that shouldn't make any difference. How are you determining that the
form is not navigating? Are you looking at the Record Number in the
Navigation Bar? Are you sure that the ComboBox still has "[Event
Procedure]" entered in the AfterUpdate event property? Cutting and Pasting
will usually cause you to lose that and then the code (while still present)
never actually runs.

Otherwise, post the code behind your ComboBox.
 
G

Guest

Ooops, here's the code...
________________________________Option Compare Database

Private Sub Status_Click()
End Sub

Private Sub Status_DblClick(Cancel As Integer)
End Sub

Private Sub Combo107_AfterUpdate()

End Sub

Private Sub Form_Close()

End Sub

Private Sub TabCtl51_Change()
End Sub
Private Sub Command102_Click()
On Error GoTo Err_Command102_Click

Dim stDocName As String

stDocName = "MyCollaborations"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Command102_Click:
Exit Sub

Err_Command102_Click:
MsgBox Err.Description
Resume Exit_Command102_Click

End Sub
Private Sub Combo102_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo102], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Private Sub Combo106_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo106], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Private Sub Combo108_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo108], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Private Sub Combo110_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo110], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Private Sub Combo116_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo116], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

_______________________________________________

Rick Brandt said:
HMBRick said:
No, I haven't added a subform. Is it an issue that the combo box is
on the tab, and attempting to navigate the larger form?

No, that shouldn't make any difference. How are you determining that the
form is not navigating? Are you looking at the Record Number in the
Navigation Bar? Are you sure that the ComboBox still has "[Event
Procedure]" entered in the AfterUpdate event property? Cutting and Pasting
will usually cause you to lose that and then the code (while still present)
never actually runs.

Otherwise, post the code behind your ComboBox.
 
R

Rick Brandt

HMBRick said:
Ooops, here's the code...

Your code includes AfterUpdate events for SEVERAL ComboBoxes. Which one is
the one you are are expecting to do something? It looks like you are
copying and pasting and ending up with different names each time and then
not cleaning up the orphaned code (deleting a control does not delete code
that was attached to it).

I would clean up all of that code, give your ComboBox a meaningful name and
create the code for it once more to see what happens.
________________________________Option Compare Database

Private Sub Status_Click()
End Sub

Private Sub Status_DblClick(Cancel As Integer)
End Sub

Private Sub Combo107_AfterUpdate()

End Sub

Private Sub Form_Close()

End Sub

Private Sub TabCtl51_Change()
End Sub
Private Sub Command102_Click()
On Error GoTo Err_Command102_Click

Dim stDocName As String

stDocName = "MyCollaborations"
DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_Command102_Click:
Exit Sub

Err_Command102_Click:
MsgBox Err.Description
Resume Exit_Command102_Click

End Sub
Private Sub Combo102_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo102], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Private Sub Combo106_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo106], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Private Sub Combo108_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo108], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Private Sub Combo110_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo110], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

Private Sub Combo116_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(Me![Combo116], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

_______________________________________________

Rick Brandt said:
HMBRick said:
No, I haven't added a subform. Is it an issue that the combo box is
on the tab, and attempting to navigate the larger form?

No, that shouldn't make any difference. How are you determining
that the form is not navigating? Are you looking at the Record
Number in the Navigation Bar? Are you sure that the ComboBox still
has "[Event Procedure]" entered in the AfterUpdate event property?
Cutting and Pasting will usually cause you to lose that and then the
code (while still present) never actually runs.

Otherwise, post the code behind your ComboBox.
 

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

Top