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  

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



 
 
Thread Tools Display Modes
  #1  
Old April 7th, 2006, 06:50 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Make a text box(s) Tab stop be YES if a given previous field= yes

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
  #2  
Old April 7th, 2006, 07:09 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Make a text box(s) Tab stop be YES if a given previous field= yes

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

  #3  
Old April 10th, 2006, 01:02 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Make a text box(s) Tab stop be YES if a given previous field=

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

  #4  
Old April 10th, 2006, 04:12 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Make a text box(s) Tab stop be YES if a given previous field=

Anyone have any ideas.

"babs" wrote:

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

  #5  
Old April 10th, 2006, 06:01 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Make a text box(s) Tab stop be YES if a given previous field=

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

  #6  
Old April 11th, 2006, 10:21 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Make a text box(s) Tab stop be YES if a given previous field=

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:

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


  #7  
Old April 11th, 2006, 10:24 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Make a text box(s) Tab stop be YES if a given previous field=

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

"babs" wrote:

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:

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


  #8  
Old April 12th, 2006, 03:31 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Make a text box(s) Tab stop be YES if a given previous field=

STILL NEED HELP - ANYONE???

"babs" wrote:

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

"babs" wrote:

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:

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


 




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
Edit/Add record in form from cmdButton doodle General Discussion 3 December 28th, 2005 03:06 AM
Add New Field to DB Karen Database Design 7 October 19th, 2005 08:03 PM
Query for 'confirmation' rogge Running & Setting Up Queries 8 April 19th, 2005 03:26 PM
Change font of part of text John Powerpoint 7 March 15th, 2005 10:10 AM
Help with design Ronnie Database Design 6 March 12th, 2005 02:53 PM


All times are GMT +1. The time now is 02:41 AM.


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