I assume you have a field in your table (autonumber format) called
MyID If you haven’t then add one before you start.
I assume you have a form based on your table which is Continuous Format
I assume you are using MS Access 2003
1 Open the form in design view
2 If there is no Form Header then click the View tab at the top of the screen and select Form Header/Footer
3 Add a new Text Box to the Header section.
4 Right Click the next Text Box and select Properties from the option box
5 Select the top row of the column called Other (which is the Name row) and change the name to txtActive
6 Still in design view, select the form -
do this by clicking the grey area outside the details section.
To check that you have done this – in the properties box / data column / record source
you should see the name of the “table” not a table field.
7 In the properties box select the Event column
8 Select the OnCurrent row
9 Select the build option -
that the 3 … (full stops)
10 Select Code Builder from the option box
11 You will see this
Private Sub Form_Current()
End Sub
12 In between these 2 lines of code add this
Me.txtActive = Me.MyID
13 Your code should now look like this
Private Sub Form_Current()
Me.txtActive = Me.MyID
End Sub
14 Click the Save icon at the top of the screen then the Red Close button – to return the form design
15 Drag the bottom of the Details section down – you now have a space underneath all the other controls.
16 Add a new Text Box – call it
txtBackGround
17 Select the Details section of your form – do this by clicking the line at the top of the section (it has the word Detail in it).
The line will go Black
18 In the properties box go to the Format Column and copy the Background colour – a method to do this is to select the number then press Control X
and then Control V.
19 Select txtBackGround
20 In the Format Column paste the number into the Background color row – so that the background of txtBackGround and the details section are now the same.
21 Still in the Format Column set the Border Style to Transparent
22 Still txtBackGround selected click the Format Tab (at the top of the screen) and select Conditional Formatting
23 Change Condition1 to
“Expression Is”
24 Add this into the box
[txtActive] = [MyID]
25 Change the Fill/Back Colour to Yellow (or whatever you want)
26 Click OK
27 Still with txtBackGround selected
click the Format icon (at the top of the screen) and select Send To Back
28 In the properties box (with txtBackGround still selected) in the Format Coloum set the Left row to 0cm
29 Also set the Top row to 0cm.
30 Using your mouse, stretch bottom and right hand edge of txtBackground so if complete fills the area behind all the other controls.
31 Now (as you changed the details height earlier) reset txtBackground height and then reset the Details section height – so it looks OK.
Don’t forget that (as txtBakGround needs to fill the entire details section) you should move the bottom of the details section up until it touches the bottom of txtBackground
32 Select txtActive in the header section.
33 In the Format Column of the properties box select the Visible row and select No.
34 Save
35 Go to Form View and see if this is what you want.