Alternating Background FixUpload ImagesLink Chris Bezant 16 months ago
Hello Rick
Many tines you have commented about the alternating background colour. You asked for any help about this so here is my solution.
I adopted your idea of a template database and added a few features. The template database was saved as an Access template, so it appears on my Access start screen. I also adopted the idea of single and continuous template forms using the underscore naming convention to put them at the top of the form list.
In each form template I included code to fix the settings that I normally set every time. If there is a situation where these standard settings are inappropriate, I simply remove the relevant code. It is easier to remove unwanted code than write it every time.
The setting you mentioned is the alternating background colour. In the forms On Load event I have the following lines:
Other settings are as follows: I always like to remove tab stops from ID fields and buttons so here is my code for that:
Sub RemoveTabStopsFromIDFields()
Dim Ctl As Control
'----------------------------------------------------------------------------- ' Check all controls on form '----------------------------------------------------------------------------- For Each Ctl In Controls '----------------------------------------------------------------------------- ' Only process text boxes and buttons '----------------------------------------------------------------------------- If Ctl.ControlType = acTextBox _ Or Ctl.ControlType = acCommandButton Then If Right(Ctl.Name, 2) = "ID" _ Or Ctl.ControlType = acCommandButton _ Then Ctl.TabStop = False End If End If
If Me.DefaultView = CONTINUOUSFORM Then Me.ScrollBars = SCROLLBARSVERTICALONLY Me.AllowEdits = False Me.AllowDeletions = False Else Me.ScrollBars = Scrollbarsnone End If
That is awesome. Thank you so much for sharing. This would be a great thing for the Developer students. Unfortunately it's way over the head of 90% of the other Access students though. I love it though!
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.