Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Format, Continuous Forms

Status
Not open for further replies.

darinmc

Technical User
Feb 27, 2005
171
GB
Hi
I have seen similar posts BUT hopefully some1 will be able to get me there easier and quicker.

I have a form (continuous), I can either use a box or preferably use the BackColour of the details (If Possible)

On the form i will display more detail, However what i'm trying to achieve is alternate colours BUT here is the complication...

E.g.(Rota form)
Empreg Names(alphabetical) + etc etc
3254 Darin Toto + ...
3254 Darin Toto + ...
425 Eroll Marshal + ...
6523 Frank Butter + ...
6523 Frank Butter + ...

The First thing i'm trying to do (using Empreg), 1st record [3254], Box Fill colour OR Details section = white (16777215)
Next record [425] = Pale yellow (15794175)

To sum it up, each time the Empreg changes it will change the alternate records backcolour.

Is this possible?
WHERE and WHAT sort of coding would I use?
When I print the records, will it print in this way as well or would I have to create a report to achieve this?

I do have more questions which i would like to ask later after solving each individual problem..

Hope U can help, Plz?

Thx
Dain
 
Hi
Thx for that response.. I have rebuilt another form..

This works a lot quicker. I created the txt box [strFormInfo] and sized it along the row and with conditional format, the colour is now ok.


[strFormInfo] = "OldEven" (yellow on yellow)
[strFormInfo] = "OldOdd" (white on white)

i'm not sure what you mean with this?
Do I create extra txt boxes or WHERE do i place [strFormInfo] = "OldOdd" ???

Thx
Darin
 
ok, I realise you put those commands
[strFormInfo] = "OldOdd"
into the conditional format... I will continue playing around with this as its starting to take shape now.
Thx for the moment :)
Darin
 
Take a look at this demo.

1) I added some code to the setFrmInfo to keep the code from crashing.
2)Look at the conditional formatting. The line is a textbox using conditional formatting.
3) I modified the query to take out the date criteria to show you how fast it will handle 10k records.

I think on your original you added additional textboxes for shading purposes. Not necessary: a font color with the same background is invisible. (ie. yelllow font, yellow background)
 
The below code is taken from the module

Code:
Public Sub setFrmInfo()
  Dim rs As DAO.Recordset
  Dim lngCount As Long
  Dim lngID As Long
  Dim strType As String
  DBEngine.SetOption dbMaxLocksPerFile, 20000
  Set rs = CurrentDb.OpenRecordset("qryUtable", dbOpenDynaset)

Form Load
I have included the tWEdt as being set BUT this will vary according to what the user selects from a calendar
Code:
Private Sub Form_Load()
Dim WEdt

Me.tWEdt = Format(#11/25/2008#, "dd/mm/yyyy")
  If MsgBox("This will update all record for form info.  It will take a few second." & vbCrLf & "Do you want to?", vbYesNo) Then
    Call mdlFrmInfo.setFrmInfo
  End If
End Sub

I want to be setting the w/ending date (tWEdt) with a calendar when the form loads, How would I change the module code to reflect
e.g. Set rs = CurrentDb.OpenRecordset("qryUtable", dbOpenDynaset) where WEdate [red](In Query)[/red] = tWEdt [red](On the Form Load)[/red]

Sorry if i'm confusing things, basically, I want the Module query to Look up the tWEdt on the form and i'm not sure how you whould setup the where clause in the ...CurrentDb.OpenRecordset...

Thx
Darin
 
Take a look at this design
1. Look at the new query
2. Look at the form code
3. Look at the module code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top