By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,807 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,807 IT Pros & Developers. It's quick & easy.

Nav Bar on Form doesn't work

P: n/a
I guess this is simple, but I'm stuck.

I am trying to write a simple app - Newspapers and their circulation by
town.

tables:
tblPaper - ID (autonum, key) and Newspaper (indexed)
tblTown - ID (autonum, key) and Town(indexed)
tblPaperTown - PaperID, TownID, DailyCirc, SundayCirc

I have a form, frmPapersAndTowns, that opens with a combo box and the
nav bar at the bottom. Combo box is cbopaper.
Data: SELECT [tblNewspaper].[NewspaperID], [tblNewspaper].[Newspaper]
FROM tblNewspaper;

AfterUpdate:
Private Sub cboPaper_AfterUpdate()
Forms![frmPapersAndTowns]![sfrmTownsForPaper].Visible = True

DoCmd.ShowAllRecords
Me.cboPaper.Requery

End Sub

Format: 2 cols, bound =1, width 0,2"

This works if I choose a paper from the dropdown box. But if I use the
nav bar on the bottom, nothing happens. The record count says 10
(correct) and the number changes, the screen blinks, but the data in
the combo box and on the subform stays the same.

I'm still new to forms - thanks.
sara

Nov 13 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
sara wrote:
I guess this is simple, but I'm stuck.

I am trying to write a simple app - Newspapers and their circulation
by town.

tables:
tblPaper - ID (autonum, key) and Newspaper (indexed)
tblTown - ID (autonum, key) and Town(indexed)
tblPaperTown - PaperID, TownID, DailyCirc, SundayCirc

I have a form, frmPapersAndTowns, that opens with a combo box and the
nav bar at the bottom. Combo box is cbopaper.
Data: SELECT [tblNewspaper].[NewspaperID], [tblNewspaper].[Newspaper]
FROM tblNewspaper;

AfterUpdate:
Private Sub cboPaper_AfterUpdate()
Forms![frmPapersAndTowns]![sfrmTownsForPaper].Visible = True

DoCmd.ShowAllRecords
Me.cboPaper.Requery

End Sub

Format: 2 cols, bound =1, width 0,2"

This works if I choose a paper from the dropdown box. But if I use
the nav bar on the bottom, nothing happens. The record count says 10
(correct) and the number changes, the screen blinks, but the data in
the combo box and on the subform stays the same.

I'm still new to forms - thanks.
sara


What are you expecting to happen? Is the ComboBox bound or are you using it
to navigate on the main form? A ComboBox can be used for one of those
operations, but not both.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a
I am expecting the form to display the "NEXT" newspaper and all the
towns/circulation associated with it.

The combo box is unbound. I don't think I am using it to navigate on
the main form, but then again, I'm not sure I really know what
"Navigate on the main form means". I am using it to select the
newspaper for which the user would like to see the towns/circ. Nothing
else. Select a paper from the drop-down; see the subform with all the
towns/circ.

Sorry to be so dense - this is all new to me.
Sara

Nov 13 '05 #3

P: n/a
I am expecting the form to display the "NEXT" newspaper and all the
towns/circulation associated with it.

The combo box is unbound. I don't think I am using it to navigate on
the main form, but then again, I'm not sure I really know what
"Navigate on the main form means". I am using it to select the
newspaper for which the user would like to see the towns/circ. Nothing
else. Select a paper from the drop-down; see the subform with all the
towns/circ.

Sorry to be so dense - this is all new to me.
Sara

Nov 13 '05 #4

P: n/a
I am expecting the form to display the "NEXT" newspaper and all the
towns/circulation associated with it.

The combo box is unbound. I don't think I am using it to navigate on
the main form, but then again, I'm not sure I really know what
"Navigate on the main form means". I am using it to select the
newspaper for which the user would like to see the towns/circ. Nothing
else. Select a paper from the drop-down; see the subform with all the
towns/circ.

Sorry to be so dense - this is all new to me.
Sara

Nov 13 '05 #5

P: n/a
I am expecting the form to display the "NEXT" newspaper and all the
towns/circulation associated with it.

The combo box is unbound. I don't think I am using it to navigate on
the main form, but then again, I'm not sure I really know what
"Navigate on the main form means". I am using it to select the
newspaper for which the user would like to see the towns/circ. Nothing
else. Select a paper from the drop-down; see the subform with all the
towns/circ.

Sorry to be so dense - this is all new to me.
Sara

Nov 13 '05 #6

P: n/a
sara wrote:
I am expecting the form to display the "NEXT" newspaper and all the
towns/circulation associated with it.

The combo box is unbound. I don't think I am using it to navigate on
the main form, but then again, I'm not sure I really know what
"Navigate on the main form means". I am using it to select the
newspaper for which the user would like to see the towns/circ.
Nothing else. Select a paper from the drop-down; see the subform with
all the towns/circ.

Sorry to be so dense - this is all new to me.
Sara

Sounds like you are inter-mixing different concepts.

Normally the MasterLink ChildLink properties of a subform will create a link
between one or more fields in the two data sets so that when you navigate in
the parent record you see the corresponding records in the subform. When
this is set correctly it won't matter HOW the parent form is navigated. You
could use the buttons, apply a filter, change the sort order, etc., and
regardless of the methof used the subform will stay synchronized.

Your MasterLink property appears to be pointing to the ComboBox and since
that is unbound it does not respond to record navigation of the parent form.
Ergo, since the subform is responding to the Unbound CombBox it is not
responding to navigation in the parent either.

Now, if you were to bind the ComboBox then any time you changed it you would
be editing the current parent record and I don't think you want that either.

What you want is to set the MasterLink property of the subform to the
appropriate field in the parent form so that the subform responds as you use
the navigation buttons. Then delete the existing ComboBox and add back a
new one making sure that the ToolBox wizard is enabled.

One of the wizard choices for a ComboBox creates a ComboBox that causes the
form to navigate to the record with the matching value selected from the
list. If you use that you will end up with a "Navigation ComboBox". It
will not be bound, but code will run each time you make an entry that causes
the parent record to move to a that record. With your subform MasterLink
now properly set it will stay synchronized with the parent form regardless
of whether you use the ComboBox to navigate or the normal navigation
buttons.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #7

P: n/a
sara wrote:
I am expecting the form to display the "NEXT" newspaper and all the
towns/circulation associated with it.

The combo box is unbound. I don't think I am using it to navigate on
the main form, but then again, I'm not sure I really know what
"Navigate on the main form means". I am using it to select the
newspaper for which the user would like to see the towns/circ.
Nothing else. Select a paper from the drop-down; see the subform with
all the towns/circ.

Sorry to be so dense - this is all new to me.
Sara

Sounds like you are inter-mixing different concepts.

Normally the MasterLink ChildLink properties of a subform will create a link
between one or more fields in the two data sets so that when you navigate in
the parent record you see the corresponding records in the subform. When
this is set correctly it won't matter HOW the parent form is navigated. You
could use the buttons, apply a filter, change the sort order, etc., and
regardless of the methof used the subform will stay synchronized.

Your MasterLink property appears to be pointing to the ComboBox and since
that is unbound it does not respond to record navigation of the parent form.
Ergo, since the subform is responding to the Unbound CombBox it is not
responding to navigation in the parent either.

Now, if you were to bind the ComboBox then any time you changed it you would
be editing the current parent record and I don't think you want that either.

What you want is to set the MasterLink property of the subform to the
appropriate field in the parent form so that the subform responds as you use
the navigation buttons. Then delete the existing ComboBox and add back a
new one making sure that the ToolBox wizard is enabled.

One of the wizard choices for a ComboBox creates a ComboBox that causes the
form to navigate to the record with the matching value selected from the
list. If you use that you will end up with a "Navigation ComboBox". It
will not be bound, but code will run each time you make an entry that causes
the parent record to move to a that record. With your subform MasterLink
now properly set it will stay synchronized with the parent form regardless
of whether you use the ComboBox to navigate or the normal navigation
buttons.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.