It sounds like you are saying that when you are working on a new record, you
want the [TruckHours] control unlocked. How 'bout if your code checks the
Me.NewRecord property?

Signature
Regards
Jeff Boyce
www.InformationFutures.net
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
> I have the below code added to the after update event of the grossweight
> field. the default value of both grossweight and truck hours for a new
[quoted text clipped - 18 lines]
> thanks,
> barb
babs - 23 Oct 2007 12:51 GMT
sounds good - not sure of the code to use and where to put it - on what
event???
Thanks,
Barb
wrote:
> It sounds like you are saying that when you are working on a new record, you
> want the [TruckHours] control unlocked. How 'bout if your code checks the
[quoted text clipped - 25 lines]
> > thanks,
> > barb
babs - 24 Oct 2007 01:49 GMT
Any input on what exact code and where to put it. I tried an IIF but am
getting a syntax error-
Thanks for your input,
Barb
> It sounds like you are saying that when you are working on a new record, you
> want the [TruckHours] control unlocked. How 'bout if your code checks the
[quoted text clipped - 25 lines]
> > thanks,
> > barb
Jeff Boyce - 24 Oct 2007 13:23 GMT
Your original post had an expression to set the locked property. Where were
you using that?

Signature
Regards
Jeff Boyce
www.InformationFutures.net
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
> Any input on what exact code and where to put it. I tried an IIF but am
> getting a syntax error-
[quoted text clipped - 31 lines]
> > > thanks,
> > > barb
babs - 29 Oct 2007 22:55 GMT
The code mentioned in the above and original post is
Attached to the after update event of the grossweight field
Me.TruckHours.Locked = Not (IsNull(Me.GrossWeight) Or Me.GrossWeight = 0)
Attached to the afterupdate event of the Truckhours
Me.GrossWeight.Locked = Not (IsNull(Me.TruckHours) Or Me.TruckHours = 0)
When I come in as a NEW record the grossweight default is 0 - so if i keep
the grossweight 0 then they may have a record that is based on HOURLY and NOT
grossweight - for some reason the truck hours is LOCKED and I need to delete
the grossweight 0 and retype the 0 in the gross weight to be able to unlock
the truckhours.
bottonm line if they have a value - other than 0 in the grossweight - they
should not be able to input truck hours and vice versa- not sure how to
resolve this. I am sure and hope it is simple but am just missing it????
thanks,
BArb
> Your original post had an expression to set the locked property. Where were
> you using that?
[quoted text clipped - 44 lines]
> > > > thanks,
> > > > barb
Jeff Boyce - 31 Oct 2007 12:05 GMT
Ah, now I see. By putting those in the AfterUpdate event, they won't
trigger until the control is updated. Default values don't update.
You could still RUN those events by calling them, when the form loads, or on
the Current event (i.e., a new record), using something like:
Call TruckHours_AfterUpdate()
Call GrossWeight_AfterUpdate()
Good luck!

Signature
Regards
Jeff Boyce
www.InformationFutures.net
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
> The code mentioned in the above and original post is
>
[quoted text clipped - 65 lines]
> > > > > thanks,
> > > > > barb