By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

Unbound check and text box's on a continuous forms

P: 121

I have a continuous form with check boxes and text boxes that I need to be unbound.

I want to apply formatting to the text boxes and check boxes on the individual records in the continuous form i understand that this is not possible unless the controls are bound to a field in a table.

I have found an example database written by Albert Kallal at the following link that allows you to use a unbound check box on individual records on a continuous form.

(Multi Select Example)

Which is great and I have got this working in my form.

the form is designed to be an equipment booking form so the idea is I have a list of equipment which the user is able to book to a date and time.

I am trying to display when a piece of equipment is booked by changing the colour of the text boxes which represent time slots throughout 09:00 - 00:00 so green if the equipment is available and red if not.

I am hoping that the above example can be manipulated to enable me to change the colour of the text boxes I must admit that I do not fully understand how the checkbox example works and have tried several times to apply the colour changes to a text box without success

The code that makes it work is as follows

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  4. Dim colCheckBox      As New Collection
  7. Public Function IsChecked(vID As Variant) As Boolean
  9.    Dim lngID      As Long
  11.    IsChecked = False
  13.    On Error GoTo exit1
  15.    lngID = colCheckBox(CStr(vID))
  16.    If lngID <> 0 Then
  17.       IsChecked = True
  18.    End If
  20. exit1:
  22. End Function
  25. Private Sub Command13_Click()
  26. Debug.Print "contact = " & Me.ContactID
  28.    If IsChecked(Me.ContactID) = False Then
  29.       colCheckBox.Add CLng(Me.ContactID), CStr(Me.ContactID)
  30.    Else
  31.       colCheckBox.Remove (CStr(Me.ContactID))
  32.    End If
  33.    Me.Check11.Requery
  35. End Sub
I hope I am making at least some sense if you download the database and take a look it will become clearer

Any help is much appreciated

Regards Phill
Mar 2 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.