Problem with Navigation Bar

P

Peter Hallett

I have a form, frm_A, which has a sub-form, sfrm_B, which in turn features a
sub-sub-form, sfrm_C.

Sfrm_B is bound to a table containing a number of records and is related to
frm_A in the usual many-one relationship. Sfrm_B also features a standard
Access navigation bar. However, when frm_A is opened, even though the
navigation bar on sfrm_B recognizes the many records to which sfrm_B is
bound, and works apparently normally, the ‘of N’ clause does not appear. For
example, with say 8 records, the bar initially shows record 1 and the buttons
can be clicked to reveal each record in turn, either forward or backward.
However, not until record No. 8 is reached does the phrase ‘of 8’ appear.
Once displayed, though it remains visible. A quicker way of revealing it is
to click the last record button.

I have encountered this problem before, in other circumstances, and used a
pair of ‘GoToRecord , , acFirst’ and ‘GoToRecord , , acLast’ commands to
force the display of the ‘of N’ clause. This time, however, it does not
work. If the commands are issued in Sub Form_Open or Sub Form_Load, of
sfrm_B, they appear to do nothing (confirmed by just issuing the ‘GoToRecord
, , acLast’ command) but they do work if issued in Sub Form_Current.
Unfortunately, however, they are of no use there. Sub Form_Current is
re-invoked every time a navigation button is clicked with the result that the
currently displayed record cannot be changed. I could possibly get around
this by writing some code to ensure that the ‘GoToRecord’ pair is only
invoked on the first entry to Sub Form_Current but by that stage the whole
work-around is starting to look a bit clumsy. Is there is a simpler solution?
 
P

Peter Hallett

I must admit that designing my own navigation bar had occurred to me but I
was hoping to avoid it. I did that in one of my other applications, because
I needed to write code behind the buttons and make them bigger – neither of
which appears to be possible with the Access standard navigation bar. As you
appreciate, though, it looks like taking a sledge hammer to a nut if
Microsoft’s own off-the-peg utility can be made to do the job. In this case,
the snag is that it does 95% of what is required and then baulks at a silly
detail. If I can’t find a simple fix to my current difficulty, though, I
will just have to bite the bullet. I am still hoping that I have missed
something but you might agree that, had MS’s designers spent a bit more time
on their navigation bar, it could have been more useful.

As to the use of sub-forms, I would find it difficult to do without them but
thanks anyway for the suggestions.
 

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