Make a text box(s) Tab stop be YES if a given previous field= yes

G

Guest

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
 
G

Guest

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
 
G

Guest

Anyone have any ideas.

babs said:
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
 
R

Ron2005

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
 
G

Guest

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
 
G

Guest

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
 
G

Guest

STILL NEED HELP - ANYONE???

babs said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top