PC Review


Reply
Thread Tools Rate Thread

check box to toggle controls enabled not working on saved records

 
 
Darryn
Guest
Posts: n/a
 
      24th Oct 2003
Hi all

I have a number of check boxes on a form which are used the toggle the
enabled status of other controls (I want to disable input into certain
fields if it is not required by the user). I have this working fine
using the following two event proceedures, so when a new record is
being entered the user checks the boxes and the fields are enabled.

Private Sub IsUnique_AfterUpdate()
If Me.IsUnique = True Then
Me.Quantity.Enabled = False
Me.SerialNumber.Enabled = True
Else
Me.Quantity.Enabled = True
Me.SerialNumber.Enabled = False
End If
and
Private Sub YearColourCoded_AfterUpdate()
Me.cboYearColourCode.Enabled = Me.YearColourCoded
End Sub

When I am navigating back through saved records the checkboxes are
still checked but the other controls are being disabled. Is there any
way to refresh or requery the check boxes when a record is reloaded.

I have tried to add the following
Me.Requiresmaintenance.Requery
Into the on current and on load event in the forms property
but it has had no effect and I am at a loss to work out how to do it

Thanks

Darryn
 
Reply With Quote
 
 
 
 
Gary Miller
Guest
Posts: n/a
 
      24th Oct 2003
Darryn,

I would suggest moving your code as-is to the OnCurrent
Event of the Form. This will get triggered every time you
move from record to record and should do what you are
looking for.

Gary Miller

"Darryn" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all
>
> I have a number of check boxes on a form which are used

the toggle the
> enabled status of other controls (I want to disable input

into certain
> fields if it is not required by the user). I have this

working fine
> using the following two event proceedures, so when a new

record is
> being entered the user checks the boxes and the fields are

enabled.
>
> Private Sub IsUnique_AfterUpdate()
> If Me.IsUnique = True Then
> Me.Quantity.Enabled = False
> Me.SerialNumber.Enabled = True
> Else
> Me.Quantity.Enabled = True
> Me.SerialNumber.Enabled = False
> End If
> and
> Private Sub YearColourCoded_AfterUpdate()
> Me.cboYearColourCode.Enabled = Me.YearColourCoded
> End Sub
>
> When I am navigating back through saved records the

checkboxes are
> still checked but the other controls are being disabled.

Is there any
> way to refresh or requery the check boxes when a record is

reloaded.
>
> I have tried to add the following
> Me.Requiresmaintenance.Requery
> Into the on current and on load event in the forms

property
> but it has had no effect and I am at a loss to work out

how to do it
>
> Thanks
>
> Darryn



 
Reply With Quote
 
 
 
 
Darryn
Guest
Posts: n/a
 
      24th Oct 2003
On Thu, 23 Oct 2003 22:40:09 -0700, "Gary Miller"
<(E-Mail Removed)> wrote:

>Darryn,
>
>I would suggest moving your code as-is to the OnCurrent
>Event of the Form. This will get triggered every time you
>move from record to record and should do what you are
>looking for.


Sorry to to sound thick but which bit of code?

I have already tried
Private Sub Form_Current()
Me.IsUnique.Requery
Me.RequiresMaintenance.Requery
End sub

But this did nothing

I also just tried to C/P
>> If Me.IsUnique = True Then
>> Me.Quantity.Enabled = False
>> Me.SerialNumber.Enabled = True
>> Else
>> Me.Quantity.Enabled = True
>> Me.SerialNumber.Enabled = False

from the IsUnique afer update event but this did nothing either

Darryn
 
Reply With Quote
 
Gary Miller
Guest
Posts: n/a
 
      24th Oct 2003

Private Sub Form_Current()
If Me.IsUnique = True Then
Me.Quantity.Enabled = False
Me.SerialNumber.Enabled = True
Else
Me.Quantity.Enabled = True
Me.SerialNumber.Enabled = False
End If
End Sub

This will have the form check the values for an existing
record as you move to it and set the controls enabled or not
based on what is already there.

Gary Miller


> Sorry to to sound thick but which bit of code?
>
> I have already tried
> Private Sub Form_Current()
> Me.IsUnique.Requery
> Me.RequiresMaintenance.Requery
> End sub
>
> But this did nothing
>
> I also just tried to C/P
> >> If Me.IsUnique = True Then
> >> Me.Quantity.Enabled = False
> >> Me.SerialNumber.Enabled = True
> >> Else
> >> Me.Quantity.Enabled = True
> >> Me.SerialNumber.Enabled = False

> from the IsUnique afer update event but this did nothing

either
>
> Darryn



 
Reply With Quote
 
Darryn
Guest
Posts: n/a
 
      25th Oct 2003
On Fri, 24 Oct 2003 08:19:09 -0700, "Gary Miller"
<(E-Mail Removed)> wrote:

>
>Private Sub Form_Current()
>If Me.IsUnique = True Then
> Me.Quantity.Enabled = False
> Me.SerialNumber.Enabled = True
> Else
> Me.Quantity.Enabled = True
> Me.SerialNumber.Enabled = False
> End If
>End Sub
>
>This will have the form check the values for an existing
>record as you move to it and set the controls enabled or not
>based on what is already there.


I was soo close with this one!!
>> I also just tried to C/P
>> >> If Me.IsUnique = True Then
>> >> Me.Quantity.Enabled = False
>> >> Me.SerialNumber.Enabled = True
>> >> Else
>> >> Me.Quantity.Enabled = True
>> >> Me.SerialNumber.Enabled = False


But I had left out this bit!!!
> End If

Thanks so much

Darryn

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
toggle button should change tooltip on toggle? not_a_commie Microsoft C# .NET 1 3rd Aug 2010 02:23 AM
Toggle Challenge - Toggle button to show or hide a subform Toucan Microsoft Access 6 16th Oct 2008 11:22 AM
Adding icon, toggle btn, or check box to form control box farseer Microsoft Dot NET Framework Forms 2 8th Nov 2006 08:06 AM
Adding icon, toggle btn, or check box to form control box farseer Microsoft C# .NET 0 6th Nov 2006 07:03 AM
"Toggle total row" button not enabled in Excel 2003 =?Utf-8?B?ZG9taW5pY19ob3dkZW4=?= Microsoft Excel Misc 0 12th Apr 2006 09:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:45 AM.