Text box contents not visible until exited

A

AnotherNewGuy

Access 2003

I have two forms, one for computers and one for printers. Each has a
Purchase Date and Warranty Expiration Date. On each, the warranty expiration
is calculated on the Before Update field of the Purchase date. Below is the
code for the computer form. Input is via a text box.

Private Sub Purchase_Date_BeforeUpdate(Cancel As Integer)
If IsNull(Me.[Warranty_Expiration]) Then
Me.[Warranty_Expiration] = DateAdd("yyyy", 3, Me.[Purchase_Date])
End If

End Sub

One the computer form, when the user tabs from the Purchase Date the
Warranty Expiration is highlighted black, and the calculated date is visible.
But on the Printer form, when the user tabs from the Purchase Date, the
Warranty Expiration is highlighted black with no date visible. If the user
tabs on or presses the back arrow the field is filled in. It's just not
visible.

I'll be darned if I can find the difference in the two forms other than the
warranty period for printers is typically 1 year. Ideas?

thx and Merry Christmas
 
J

Jeff Boyce

It's unusual to use a "form" for printing. That's what Access "reports" are
designed for.

If the text (foreground) and/or background colors matched, would that result
in not seeing the text until you left the control?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
A

AnotherNewGuy

Jeff, thanks for taking time. I need to restate my problem; after reading my
own post, I can see where it could be misinterpreted.

I use an Access application to keep track of 1200+ computers in our
organization. When we add a computer to the system, we input the info we
need on that computer on a form. When Purchase Date is input, Warranty
Expiration is calculated as 3 years from that date using the Before Update
event of Purchase Date. When the user tabs to Warranty Expiration, the field
is highlighted, and the calculated date displays in white as you'd expect.
The user can change that if necessary or accept it by tabbing forward.

I've recently added a form to use to add printers to our inventory.
Purchase Date and Warranty Expiration date are input exactly the same way,
except the calculated date for Warranty Expiration is one year from the
Purchase Date.

On the form for inputting printers, when the user inputs the Purchase Date
and tabs forward, the Purchase Date is highlighted in black, but the contents
are not visible in white as they are on the form for computers. If the user
tabs forward, the contents are there and visible as on the computer form.
I'd like the contents of the Warranty Expiration field to be visible when the
user tabs to it so he can accept or edit it as necessary.

thanks again

Jeff Boyce said:
It's unusual to use a "form" for printing. That's what Access "reports" are
designed for.

If the text (foreground) and/or background colors matched, would that result
in not seeing the text until you left the control?

Regards

Jeff Boyce
Microsoft Office/Access MVP

AnotherNewGuy said:
Access 2003

I have two forms, one for computers and one for printers. Each has a
Purchase Date and Warranty Expiration Date. On each, the warranty
expiration
is calculated on the Before Update field of the Purchase date. Below is
the
code for the computer form. Input is via a text box.

Private Sub Purchase_Date_BeforeUpdate(Cancel As Integer)
If IsNull(Me.[Warranty_Expiration]) Then
Me.[Warranty_Expiration] = DateAdd("yyyy", 3, Me.[Purchase_Date])
End If

End Sub

One the computer form, when the user tabs from the Purchase Date the
Warranty Expiration is highlighted black, and the calculated date is
visible.
But on the Printer form, when the user tabs from the Purchase Date, the
Warranty Expiration is highlighted black with no date visible. If the
user
tabs on or presses the back arrow the field is filled in. It's just not
visible.

I'll be darned if I can find the difference in the two forms other than
the
warranty period for printers is typically 1 year. Ideas?

thx and Merry Christmas
 
B

BruceM

It's still hard to follow what is going on. It seems that what you are
referring to as a field is actually a control such as text box. It is best
to keep such terminology straight.

I would use the control's After Update event rather than Before Update to
calculate the Warranty Expiration.

Regarding the Exp date for computers, you say that "the field" (the control)
is highlighted. Which control is that, Purchase Date or Exp Date? You
refer to the calculated date, so it seems you are referring to the ExpDate
field being highlighted when you tab into it. Later you refer to tabbing
out of the PurchaseDate control and having it highlighted. It seems you are
talking about two different things. In any case, it seems it is a format
property of the control. For one thing, be sure the Back Style is the same
in both cases. You could try copying the control that behaves as you want
and pasting it into the other form.

AnotherNewGuy said:
Jeff, thanks for taking time. I need to restate my problem; after reading
my
own post, I can see where it could be misinterpreted.

I use an Access application to keep track of 1200+ computers in our
organization. When we add a computer to the system, we input the info we
need on that computer on a form. When Purchase Date is input, Warranty
Expiration is calculated as 3 years from that date using the Before Update
event of Purchase Date. When the user tabs to Warranty Expiration, the
field
is highlighted, and the calculated date displays in white as you'd expect.
The user can change that if necessary or accept it by tabbing forward.

I've recently added a form to use to add printers to our inventory.
Purchase Date and Warranty Expiration date are input exactly the same way,
except the calculated date for Warranty Expiration is one year from the
Purchase Date.

On the form for inputting printers, when the user inputs the Purchase Date
and tabs forward, the Purchase Date is highlighted in black, but the
contents
are not visible in white as they are on the form for computers. If the
user
tabs forward, the contents are there and visible as on the computer form.
I'd like the contents of the Warranty Expiration field to be visible when
the
user tabs to it so he can accept or edit it as necessary.

thanks again

Jeff Boyce said:
It's unusual to use a "form" for printing. That's what Access "reports"
are
designed for.

If the text (foreground) and/or background colors matched, would that
result
in not seeing the text until you left the control?

Regards

Jeff Boyce
Microsoft Office/Access MVP

message
Access 2003

I have two forms, one for computers and one for printers. Each has a
Purchase Date and Warranty Expiration Date. On each, the warranty
expiration
is calculated on the Before Update field of the Purchase date. Below
is
the
code for the computer form. Input is via a text box.

Private Sub Purchase_Date_BeforeUpdate(Cancel As Integer)
If IsNull(Me.[Warranty_Expiration]) Then
Me.[Warranty_Expiration] = DateAdd("yyyy", 3, Me.[Purchase_Date])
End If

End Sub

One the computer form, when the user tabs from the Purchase Date the
Warranty Expiration is highlighted black, and the calculated date is
visible.
But on the Printer form, when the user tabs from the Purchase Date, the
Warranty Expiration is highlighted black with no date visible. If the
user
tabs on or presses the back arrow the field is filled in. It's just
not
visible.

I'll be darned if I can find the difference in the two forms other than
the
warranty period for printers is typically 1 year. Ideas?

thx and Merry Christmas
 

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