Here's what I did on a form bound to a finite 10 record table. Be aware that
this will only work with a finite number of records.
Method
First place an unbound control on your form. This will be a record
placeholder for your current record number. In this case it is
[Your_Control_Name]
'(Now create the number of rectangles you will want for your progression bar
and make them Invisible.)
Call them rec1, rec2, rec3, and so on.
Now add this following code to your Form's 'On Current' property.
Private Sub Form_Current()
Me.RecordsetClone.Bookmark = Me.Bookmark
Me.Your_Control_Name = Me.RecordsetClone.AbsolutePosition + 1
'(This gets the Form's current Record Number for [Your_Control_Name])
'(Adjust/remove the number of [rec]tangles that you will need in the code
sections below, in this example I wanted 10, for the number of finite records
in my table.
'(Now add the following code in the same code section as the code above.)
If Me![Your_Control_Name] = 1 Then
Me![rec1].Visible = True
Me![rec2].Visible = False
Me![rec3].Visible = False
Me![rec4].Visible = False
Me![rec5].Visible = False
Me![rec6].Visible = False
Me![rec7].Visible = False
Me![rec8].Visible = False
Me![rec9].Visible = False
Me![rec10].Visible = False
End If
If Me![Your_Control_Name] = 2 Then
Me![rec2].Visible = True
Me![rec3].Visible = False
Me![rec4].Visible = False
Me![rec5].Visible = False
Me![rec6].Visible = False
Me![rec7].Visible = False
Me![rec8].Visible = False
Me![rec9].Visible = False
Me![rec10].Visible = False
End If
If Me![Your_Control_Name] = 'next control number in your sequence.'
Me![rec3].Visible = True
Me![rec4].Visible = False
Me![rec5].Visible = False
Me![rec6].Visible = False
Me![rec7].Visible = False
Me![rec8].Visible = False
Me![rec9].Visible = False
Me![rec10].Visible = False
End If
End Sub
The 'Me![rec#].Visible = False' code lines are for when you click your
records backwards, which makes the progression go back down the scale. If you
only want the progression bar to go up, then just delete the
'Me![rec#].Visible = False' lines.
tina said:
(see my response to previous message.) Option Explicit requires that all
variables in all modules in the database be explicitly declared; you will
get the posted error message if 1) a variable anywhere in your database
modules has not be explicitly declared, or 2) if you declared a variable,
but then misspelled it when using it in a procedure. in the second case,
Access won't tell you that it's "spelled wrong", because it sees it as an
entirely different variable, that is not declared explicitly.
hth
on
your progression
bar to of
that box
with smaller
than colored
ones the
VBE checkmarked).
then should
have five
of title
bar "decrements" by
20 answering
the anyone
has