Reffer\Enable field in specific record on continuous form

avis

New member
Local time
Today, 05:07
Joined
Aug 20, 2008
Messages
6
Hi All,

I have a continuous form on my access app.
I use one of the forms as a continuous form.
Every record has a checkbox and i need that if the user will check it - i need to enable\disable the relavant field in this record only to be enabled.
I'm familiar with reffering the field somethink like:
Me.field.enable = true
But in this case it enables ALL the fields on the form and not only the matching field in the record i've checked the checkbox.

How can i reffer only the relavant field in the checked record ?

Thanks !
 
Hi avis and welcome to the forums

if you want to store which records have the check ticked and which not, then create a field in your table and bound your check box on the form to the field created in your table.
 
In a continues form if a control is enabled on the current record it is enable on all records, unfortunatly....

And I dont know a way around that... except for making the for columnar....

Maybe a way around it is use the "current" event to check and reset... but that disables ALL records again if the current record is to be disabled.
 
So you want to tell me there is no way to do ?!?
 
Namliam

I didn't quite understand if you have a way to do it or not and how ?
What alternatives do i have if i must need a continuous form ?
 
You can use Conditional Formatting to enable one control based on the value in another, and it would be record-specific.
 
Can you enable/disable columns using conditional formatting? That is new to me...

Must try that sometime... tho offhand I dont see how...

@Avis
No as far as I know there is no way to do it, but appearently according to paul, you can use Conditional Formatting to do it, but...
 
There is a cheat using lots of =Iif( control statements on the form, there was an example posted on the forum somewhere, I don't think I've deleted it yet. Look for the zip Contfrm
 
Perhaps I misunderstood the goal Mailman. My interpretation was that each record has a checkbox (Yes/No field), and for each one checked another control should be enabled. Conditional Formatting can do that. IOW, some records will have this control enabled and others disabled, depending on the checkbox. I'm not sure what you mean by enabling a column. Conditional Formatting is record specific, so it would not enable/disable an entire column.
 
column/field ... same old.. same old

Cool that conditional formatting can do that... I must try that some time... something learned today :)
 
I think you're still missing the point, mailman. A column and a field are not the same. Cell indicates a field on a given record, while column indicates that field in all records. Given the OP's statement "i need to enable\disable the relavant field in this record only," Paul's answer is the appropriate solution.
 
pbaldy - you did it !!!
Conditional format is working great !!!
It took me few minutes to understand what you mean but in the end it's doing what i was looking for!
Thanks for your assistance !!!

BTW, it will be great to know if it's possible by code as well.

THANKS !!!!!!!
 
In a report or single view form, it's fairly easy to conditionally format in code. In a continuous form, it's difficult at best (as you've already discovered).
 
It's possible in code, but only feasible if the form is in Single View, not in a Datasheet or Continuous View. For those you must use Conditional Formatting.

For a Single View Form, the code in these two events will do the job. How it works is fairly obvious:

Code:
Private Sub CheckBox_AfterUpdate()
 If CheckBox = -1 Then
  TextBox.Enabled = True
 Else
  TextBox.Enabled = False
 End If
End Sub
Code:
Private Sub Form_Current()
If CheckBox = -1 Then
  TextBox.Enabled = True
 Else
  TextBox.Enabled = False
 End If
End Sub
This code will also do the job, but the how is a little less obvious:
Code:
Private Sub CheckBox_AfterUpdate()
   TextBox.Enabled = CheckBox.Value
End Sub
Code:
Private Sub Form_Current()
  TextBox.Enabled = CheckBox.Value
End Sub

When the Checkbox is ticked, it's value is True (-1) and when unticked, it's False (0) so here you're setting TextBox.Enabled to equal CheckBox's Value. If CheckBox is True then TextBox.Enabled is also True, and vice versa.
 
Hmmm...

I thought conditional formatting were good only for well, presentation.

Could it be used for something like altering the rowsource of a combobox?
 
I thought conditional formatting were good only for well, presentation.

It is used primarily for presentation of data, but they added on the Enable/Disable control option. You can format back color, fore/font color, bold, Italic and underline text, and enable/disable the control.

Could it be used for something like altering the rowsource of a combobox?

What do you mean by this?
 
Well, if you want to use say, a cascading combobox, it's problematic in continuous form as if rowsource can change depending on a current data, the other records may go "blank" and so forth. The current solution is to overlay the combobox with a textbox. My question was whether conditional formatting can be employed for that purpose, saving the hassle of managing two control to present data and the list of values to choose from properly on a continuous form.

Did that help?
 
Well, if you want to use say, a cascading combobox, it's problematic in continuous form as if rowsource can change depending on a current data,
Did that help?

I've no problem with combos on continuous forms, what problem are you having?:confused:
 
I've no problem with combos on continuous forms, what problem are you having?:confused:

If the combobox's rowsource is always same for any given row, there's no problem at all. But when it depends on another piece of data in the same row, such as a cascading combobox for example, which filter the list in the rowsource, it can cause all other records that has value that aren't in the current filtered list to go blank.

Did that make sense?
 
I think you're still missing the point, mailman. A column and a field are not the same. Cell indicates a field on a given record, while column indicates that field in all records. Given the OP's statement "i need to enable\disable the relavant field in this record only," Paul's answer is the appropriate solution.

I know I know.... Column does not equal Field.... I mixed my words and tried to cover it up :rolleyes:

Still the eye opener that conditional formatting is for more than just formatting is a big one... And I am not alone in that respect.
 

Users who are viewing this thread

Back
Top Bottom