G
Guest
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
:
Click to show or hide original message or reply text.
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
:
Click to show or hide original message or reply text.
Was this post helpful to you?
Reply Top
babs 4/10/2006 8:11 AM PST
Anyone have any ideas.
:
Click to show or hide original message or reply text.
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
:
Click to show or hide original message or reply text.
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
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
:
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
:
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.
Was this post helpful to you?
Reply Top
babs 4/10/2006 8:11 AM PST
Anyone have any ideas.
:
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
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
:
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