A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

enable a field if a given field is checked off- otherwise- don't w



 
 
Thread Tools Display Modes
  #1  
Old April 12th, 2006, 09:13 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default enable a field if a given field is checked off- otherwise- don't w

See below:

Posted a few days ago and have not heard back for last response- not use why
staying enabled- even if uncheck the splitorder box??

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb


Was this post helpful to you?
Reply Top





Mr B 4/7/2006 11:08 AM PST



Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
..Value = ""
..Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

Click to show or hide original message or reply text.


I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb




Was this post helpful to you?
Reply Top





babs 4/9/2006 5:01 PM PST



I have set the truck2# field to not enabled. I have put in the recommended
code onto the on current event of the form and on the After update of a field
called splitorder that I will have them check off - if it entails 2 trucks(
yes that is the max. 1 or 2 trucks only). However I am getting an error and
it goes to the code me.truck2#.enabled=true line. Usually when I type the
me. it prompt me for the fields I do not see the truck2#. Check the field
name and it matches exactly what I have on my form. Is there any syntax
error.

Private Sub Splitorder_AfterUpdate()
If Not IsNull(Me.Splitorder) Then
Me.Truck2#.Enabled = True
Else
With Me.Truck2#
..Value = ""
..Enabled = False
End With
End If


Thanks,
Barb


"Mr B" wrote:

Click to show or hide original message or reply text.


Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb




Was this post helpful to you?
Reply Top





babs 4/10/2006 8:11 AM PST



Anyone have any ideas.

"babs" wrote:

Click to show or hide original message or reply text.


I have set the truck2# field to not enabled. I have put in the recommended
code onto the on current event of the form and on the After update of a field
called splitorder that I will have them check off - if it entails 2 trucks(
yes that is the max. 1 or 2 trucks only). However I am getting an error and
it goes to the code me.truck2#.enabled=true line. Usually when I type the
me. it prompt me for the fields I do not see the truck2#. Check the field
name and it matches exactly what I have on my form. Is there any syntax
error.

Private Sub Splitorder_AfterUpdate()
If Not IsNull(Me.Splitorder) Then
Me.Truck2#.Enabled = True
Else
With Me.Truck2#
.Value = ""
.Enabled = False
End With
End If


Thanks,
Barb


"Mr B" wrote:

Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb




Was this post helpful to you?
Reply Top





Ron2005 4/10/2006 10:07 AM PST



Were you looking at the properties record source or at the properties
Name?

If you did a copy of truck1 and pasted and then changed the source the
name would be textnn and not truck2.

Ron




Was this post helpful to you?
Reply Top





babs 4/11/2006 2:20 PM PST



That was it. However, I have at least 5 other fields that I need to do the
same thing to. such as truckhours2, fuelrate2, etc. Not sure of how in the
above code that I can incoporate more fields - do I rewrite the whole thing
over and over again???

Please show if possible with at least one or two other fields.

Thanks,
Babs

"Ron2005" wrote:

Click to show or hide original message or reply text.


Were you looking at the properties record source or at the properties
Name?

If you did a copy of truck1 and pasted and then changed the source the
name would be textnn and not truck2.

Ron





Was this post helpful to you?
Reply Top





babs 4/11/2006 2:23 PM PST



Also just noticed that when I look through old records if I check off the
splitorder. Then truck2 is enable on every record now- even if it isn't a
split order???

Thanks,
Barb





  #2  
Old April 12th, 2006, 10:03 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default enable a field if a given field is checked off- otherwise- don't w

Try using a radial button. When set to false (default) the
2ndtruck.Enabled=False. When radialbutton is true 2ndtruck.enabled=true.
--
Roy


"babs" wrote:

See below:

Posted a few days ago and have not heard back for last response- not use why
staying enabled- even if uncheck the splitorder box??

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb


Was this post helpful to you?
Reply Top





Mr B 4/7/2006 11:08 AM PST



Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

Click to show or hide original message or reply text.


I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb




Was this post helpful to you?
Reply Top





babs 4/9/2006 5:01 PM PST



I have set the truck2# field to not enabled. I have put in the recommended
code onto the on current event of the form and on the After update of a field
called splitorder that I will have them check off - if it entails 2 trucks(
yes that is the max. 1 or 2 trucks only). However I am getting an error and
it goes to the code me.truck2#.enabled=true line. Usually when I type the
me. it prompt me for the fields I do not see the truck2#. Check the field
name and it matches exactly what I have on my form. Is there any syntax
error.

Private Sub Splitorder_AfterUpdate()
If Not IsNull(Me.Splitorder) Then
Me.Truck2#.Enabled = True
Else
With Me.Truck2#
.Value = ""
.Enabled = False
End With
End If


Thanks,
Barb


"Mr B" wrote:

Click to show or hide original message or reply text.


Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb




Was this post helpful to you?
Reply Top





babs 4/10/2006 8:11 AM PST



Anyone have any ideas.

"babs" wrote:

Click to show or hide original message or reply text.


I have set the truck2# field to not enabled. I have put in the recommended
code onto the on current event of the form and on the After update of a field
called splitorder that I will have them check off - if it entails 2 trucks(
yes that is the max. 1 or 2 trucks only). However I am getting an error and
it goes to the code me.truck2#.enabled=true line. Usually when I type the
me. it prompt me for the fields I do not see the truck2#. Check the field
name and it matches exactly what I have on my form. Is there any syntax
error.

Private Sub Splitorder_AfterUpdate()
If Not IsNull(Me.Splitorder) Then
Me.Truck2#.Enabled = True
Else
With Me.Truck2#
.Value = ""
.Enabled = False
End With
End If


Thanks,
Barb


"Mr B" wrote:

Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb




Was this post helpful to you?
Reply Top





Ron2005 4/10/2006 10:07 AM PST



Were you looking at the properties record source or at the properties
Name?

If you did a copy of truck1 and pasted and then changed the source the
name would be textnn and not truck2.

Ron




Was this post helpful to you?
Reply Top


  #3  
Old April 13th, 2006, 07:03 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default enable a field if a given field is checked off- otherwise- don

Not sure what a RADIAL button is- if it is a command button how can you tell
if it is checked off- would like the split order to show yes, or checked if
there is going to be 2 trucks.

Thanks,
Barb

"nczimm" wrote:

Try using a radial button. When set to false (default) the
2ndtruck.Enabled=False. When radialbutton is true 2ndtruck.enabled=true.
--
Roy


"babs" wrote:

See below:

Posted a few days ago and have not heard back for last response- not use why
staying enabled- even if uncheck the splitorder box??

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb


Was this post helpful to you?
Reply Top





Mr B 4/7/2006 11:08 AM PST



Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

Click to show or hide original message or reply text.


I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb




Was this post helpful to you?
Reply Top





babs 4/9/2006 5:01 PM PST



I have set the truck2# field to not enabled. I have put in the recommended
code onto the on current event of the form and on the After update of a field
called splitorder that I will have them check off - if it entails 2 trucks(
yes that is the max. 1 or 2 trucks only). However I am getting an error and
it goes to the code me.truck2#.enabled=true line. Usually when I type the
me. it prompt me for the fields I do not see the truck2#. Check the field
name and it matches exactly what I have on my form. Is there any syntax
error.

Private Sub Splitorder_AfterUpdate()
If Not IsNull(Me.Splitorder) Then
Me.Truck2#.Enabled = True
Else
With Me.Truck2#
.Value = ""
.Enabled = False
End With
End If


Thanks,
Barb


"Mr B" wrote:

Click to show or hide original message or reply text.


Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb




Was this post helpful to you?
Reply Top





babs 4/10/2006 8:11 AM PST



Anyone have any ideas.

"babs" wrote:

Click to show or hide original message or reply text.


I have set the truck2# field to not enabled. I have put in the recommended
code onto the on current event of the form and on the After update of a field
called splitorder that I will have them check off - if it entails 2 trucks(
yes that is the max. 1 or 2 trucks only). However I am getting an error and
it goes to the code me.truck2#.enabled=true line. Usually when I type the
me. it prompt me for the fields I do not see the truck2#. Check the field
name and it matches exactly what I have on my form. Is there any syntax
error.

Private Sub Splitorder_AfterUpdate()
If Not IsNull(Me.Splitorder) Then
Me.Truck2#.Enabled = True
Else
With Me.Truck2#
.Value = ""
.Enabled = False
End With
End If


Thanks,
Barb


"Mr B" wrote:

Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb




Was this post helpful to you?
Reply Top





Ron2005 4/10/2006 10:07 AM PST



Were you looking at the properties record source or at the properties
Name?

If you did a copy of truck1 and pasted and then changed the source the
name would be textnn and not truck2.

Ron

  #4  
Old April 13th, 2006, 09:42 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default enable a field if a given field is checked off- otherwise- don



"babs" wrote:

Not sure what a RADIAL button is- if it is a command button how can you tell
if it is checked off- would like the split order to show yes, or checked if
there is going to be 2 trucks.

Thanks,
Barb

"nczimm" wrote:

Try using a radial button. When set to false (default) the
2ndtruck.Enabled=False. When radialbutton is true 2ndtruck.enabled=true.
--
Roy


"babs" wrote:

See below:

Posted a few days ago and have not heard back for last response- not use why
staying enabled- even if uncheck the splitorder box??

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb


Was this post helpful to you?
Reply Top





Mr B 4/7/2006 11:08 AM PST



Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

Click to show or hide original message or reply text.


I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb



Was this post helpful to you?
Reply Top





babs 4/9/2006 5:01 PM PST



I have set the truck2# field to not enabled. I have put in the recommended
code onto the on current event of the form and on the After update of a field
called splitorder that I will have them check off - if it entails 2 trucks(
yes that is the max. 1 or 2 trucks only). However I am getting an error and
it goes to the code me.truck2#.enabled=true line. Usually when I type the
me. it prompt me for the fields I do not see the truck2#. Check the field
name and it matches exactly what I have on my form. Is there any syntax
error.

Private Sub Splitorder_AfterUpdate()
If Not IsNull(Me.Splitorder) Then
Me.Truck2#.Enabled = True
Else
With Me.Truck2#
.Value = ""
.Enabled = False
End With
End If


Thanks,
Barb


"Mr B" wrote:

Click to show or hide original message or reply text.


Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb



Was this post helpful to you?
Reply Top





babs 4/10/2006 8:11 AM PST



Anyone have any ideas.

"babs" wrote:

Click to show or hide original message or reply text.


I have set the truck2# field to not enabled. I have put in the recommended
code onto the on current event of the form and on the After update of a field
called splitorder that I will have them check off - if it entails 2 trucks(
yes that is the max. 1 or 2 trucks only). However I am getting an error and
it goes to the code me.truck2#.enabled=true line. Usually when I type the
me. it prompt me for the fields I do not see the truck2#. Check the field
name and it matches exactly what I have on my form. Is there any syntax
error.

Private Sub Splitorder_AfterUpdate()
If Not IsNull(Me.Splitorder) Then
Me.Truck2#.Enabled = True
Else
With Me.Truck2#
.Value = ""
.Enabled = False
End With
End If


Thanks,
Barb


"Mr B" wrote:

Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb



Was this post helpful to you?
Reply Top





Ron2005 4/10/2006 10:07 AM PST

  #5  
Old April 13th, 2006, 09:43 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default enable a field if a given field is checked off- otherwise- don

I used an option button - have same problem as the check box. Once it is
checked on one record - now all records truck 2 field are enabled??????-
before and after. Old and new!

Please help,
Thanks,
Barb

"babs" wrote:

Not sure what a RADIAL button is- if it is a command button how can you tell
if it is checked off- would like the split order to show yes, or checked if
there is going to be 2 trucks.

Thanks,
Barb

"nczimm" wrote:

Try using a radial button. When set to false (default) the
2ndtruck.Enabled=False. When radialbutton is true 2ndtruck.enabled=true.
--
Roy


"babs" wrote:

See below:

Posted a few days ago and have not heard back for last response- not use why
staying enabled- even if uncheck the splitorder box??

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb


Was this post helpful to you?
Reply Top





Mr B 4/7/2006 11:08 AM PST



Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

Click to show or hide original message or reply text.


I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb



Was this post helpful to you?
Reply Top





babs 4/9/2006 5:01 PM PST



I have set the truck2# field to not enabled. I have put in the recommended
code onto the on current event of the form and on the After update of a field
called splitorder that I will have them check off - if it entails 2 trucks(
yes that is the max. 1 or 2 trucks only). However I am getting an error and
it goes to the code me.truck2#.enabled=true line. Usually when I type the
me. it prompt me for the fields I do not see the truck2#. Check the field
name and it matches exactly what I have on my form. Is there any syntax
error.

Private Sub Splitorder_AfterUpdate()
If Not IsNull(Me.Splitorder) Then
Me.Truck2#.Enabled = True
Else
With Me.Truck2#
.Value = ""
.Enabled = False
End With
End If


Thanks,
Barb


"Mr B" wrote:

Click to show or hide original message or reply text.


Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb



Was this post helpful to you?
Reply Top





babs 4/10/2006 8:11 AM PST



Anyone have any ideas.

"babs" wrote:

Click to show or hide original message or reply text.


I have set the truck2# field to not enabled. I have put in the recommended
code onto the on current event of the form and on the After update of a field
called splitorder that I will have them check off - if it entails 2 trucks(
yes that is the max. 1 or 2 trucks only). However I am getting an error and
it goes to the code me.truck2#.enabled=true line. Usually when I type the
me. it prompt me for the fields I do not see the truck2#. Check the field
name and it matches exactly what I have on my form. Is there any syntax
error.

Private Sub Splitorder_AfterUpdate()
If Not IsNull(Me.Splitorder) Then
Me.Truck2#.Enabled = True
Else
With Me.Truck2#
.Value = ""
.Enabled = False
End With
End If


Thanks,
Barb


"Mr B" wrote:

Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb



Was this post helpful to you?
Reply Top





Ron2005 4/10/2006 10:07 AM PST

  #6  
Old April 13th, 2006, 11:00 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default enable a field if a given field is checked off- otherwise- don

I may not be understanding correctly. You have three truck 2 fields, if I
have it correctly. You want to enable all three truck 2 fields when they want
to split a load.

Enabeling the truck 2 fields will open up each to to all the records bound
to that field. I am guessing that the truck 1 fields and the truck 2 fields
are not bound to the same data sets. If you are selecting from the same data
sets and saving to the same tables then there will need to be some mechanism
more than just enabling fields to make this work. This would take some
definition of what makes a truck one or two and what the effect of this is,
then reflect that in the database and make it a criteria in your selections.

--
Roy


"babs" wrote:

I used an option button - have same problem as the check box. Once it is
checked on one record - now all records truck 2 field are enabled??????-
before and after. Old and new!

Please help,
Thanks,
Barb

"babs" wrote:

Not sure what a RADIAL button is- if it is a command button how can you tell
if it is checked off- would like the split order to show yes, or checked if
there is going to be 2 trucks.

Thanks,
Barb

"nczimm" wrote:

Try using a radial button. When set to false (default) the
2ndtruck.Enabled=False. When radialbutton is true 2ndtruck.enabled=true.
--
Roy


"babs" wrote:

See below:

Posted a few days ago and have not heard back for last response- not use why
staying enabled- even if uncheck the splitorder box??

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb


Was this post helpful to you?
Reply Top





Mr B 4/7/2006 11:08 AM PST



Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

Click to show or hide original message or reply text.


I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb



Was this post helpful to you?
Reply Top





babs 4/9/2006 5:01 PM PST



I have set the truck2# field to not enabled. I have put in the recommended
code onto the on current event of the form and on the After update of a field
called splitorder that I will have them check off - if it entails 2 trucks(
yes that is the max. 1 or 2 trucks only). However I am getting an error and
it goes to the code me.truck2#.enabled=true line. Usually when I type the
me. it prompt me for the fields I do not see the truck2#. Check the field
name and it matches exactly what I have on my form. Is there any syntax
error.

Private Sub Splitorder_AfterUpdate()
If Not IsNull(Me.Splitorder) Then
Me.Truck2#.Enabled = True
Else
With Me.Truck2#
.Value = ""
.Enabled = False
End With
End If


Thanks,
Barb


"Mr B" wrote:

Click to show or hide original message or reply text.


Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb



Was this post helpful to you?
Reply Top





babs 4/10/2006 8:11 AM PST



Anyone have any ideas.

"babs" wrote:

Click to show or hide original message or reply text.


I have set the truck2# field to not enabled. I have put in the recommended
code onto the on current event of the form and on the After update of a field
called splitorder that I will have them check off - if it entails 2 trucks(
yes that is the max. 1 or 2 trucks only). However I am getting an error and
it goes to the code me.truck2#.enabled=true line. Usually when I type the
me. it prompt me for the fields I do not see the truck2#. Check the field
name and it matches exactly what I have on my form. Is there any syntax
error.

Private Sub Splitorder_AfterUpdate()
If Not IsNull(Me.Splitorder) Then
Me.Truck2#.Enabled = True
Else
With Me.Truck2#
.Value = ""
.Enabled = False
End With
End If


Thanks,
Barb


"Mr B" wrote:

Barb,

First, I think you might want to look more closely at your overall design
for you database. If there are occasions where you will need mutiple trucks
then you would need a table to hold the trucks assigned to the order. This
way you are not limited to just two trucks.

If you should decide to go ahead with your current design, then you can have
the truck #2 field to be disabled until you have completed the entry in the
truck #1 field.

All you need to do is to:
1) Set the Enabled of the Truck #2 field to No.
2) In the After Update event of the Truck #1 field place code like this:

If Not IsNull(Me.NameOfTruck1Field) then
Me.NameOfTruck2Field.enabled = True
Else
With Me.NameOfTruck2Field
.Value = ""
.Enabled = False
End With
End If

After an entry has been made in the Truck #1 field, the code above will
enable the Truck #2 control to allow entry. If the value for the Truck #1
field is removed, the code will also remove the value in the Truck #2 field
and disable it until an entry has again been made in the Truck #1 field.

You would also need to place this same statement in the On Current event of
the form that contains these controls.

--
HTH

Mr B


"babs" wrote:

I am invoice for trucks most of the orders entail info for only 1
TRUCK,truck1 #,truck1rate, truck1hours. However, occasionally an order
requires 2 trucks so I have the fields truck2#, truck2rate,truck2hours. I do
not want to tab to the truck 2 fields if only 1 truck is used. I was
thinking about having a field called SPLIT Order(means 2 trucks)- default
would be NO but if YES than ALSO tab to the truck2 fields. HOW can I do
this?????

Thanks,
Barb


  #7  
Old April 14th, 2006, 01:46 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default enable a field if a given field is checked off- otherwise- don

The test for turning it on and off MUST include the else

if condition 1 then
enabled = true
else
enabled = false
endif

If you do not do this then once it goes on it will stay on since
nothing is really turning it off.

  #8  
Old April 17th, 2006, 03:12 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default enable a field if a given field is checked off- otherwise- don

Ron,

I thought that is what I did. Not Clear on how code should be different.
See original post down a little by Barb- on 4/9/06 5:01. that is the code I
am using . I got rid of the with part and have errors. Would love some help
can't see why enabled is not turning off for next records????

Thanks,
Barb

"Ron2005" wrote:

The test for turning it on and off MUST include the else

if condition 1 then
enabled = true
else
enabled = false
endif

If you do not do this then once it goes on it will stay on since
nothing is really turning it off.


  #9  
Old April 18th, 2006, 03:35 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default enable a field if a given field is checked off- otherwise- don

You need to do that test also in the oncurrent event not just the
afterupdate. Just the enabling part in the oncurrent. The after update
should include the clearing of the field. You may want to use Null
instead of "" because I do not believe that the two will respond the
same if you are searching in that field. I a person does NOT touch the
button then the field will be null, but if a person touches and then
turns off the field it will be "". The two conditions will drive you
nuts when testing on that field.

(footnote the reference someone made to RADIAL button should have been
Radio Button which is what you picked, I believe. Works same as check
box just Looks different.)

  #10  
Old April 18th, 2006, 03:36 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default enable a field if a given field is checked off- otherwise- don

option button is the same as Radio button

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DCount compare table.textfield to form.text field question RNUSZ@OKDPS Using Forms 1 March 11th, 2005 02:05 AM
Hide Field when Checkmark is Checked Petra Running & Setting Up Queries 1 October 8th, 2004 03:21 AM
ASK Field Behavior Greg Mailmerge 9 July 2nd, 2004 02:44 PM
NUMBERING the pages Bob New Users 7 June 14th, 2004 12:20 AM
Supress blank lines in DOCPROPERTY field Mary Formatting Long Documents 10 May 25th, 2004 07:27 PM


All times are GMT +1. The time now is 04:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.