Problem with date field (1 Viewer)

vagelisr

Registered User.
Local time
Today, 13:18
Joined
Apr 28, 2011
Messages
87
Hi to all.

I have a form with 3 date fields.
If the last date field is empty and the mibble date field is date then on exit a add XXX years in the last field.
The point is when the last field take the focus i'm not able to read the date because the whole field is black.
If the specific field lost the focus the date is correct and i am able to see it.

Does anyone have any idea whe the field is black???

PS:To make clearer the problem I also sent a photo with the problem
 

Attachments

  • date_fields.png
    date_fields.png
    1 KB · Views: 85

sneuberg

AWF VIP
Local time
Today, 03:18
Joined
Oct 17, 2014
Messages
3,506
That's kind of weird. The fastest way to resolve this would be for you to upload the database. If you can't do that then post any code in the forms module and give us a screen shot of the textbox's properties.
 

missinglinq

AWF VIP
Local time
Today, 06:18
Joined
Jun 20, 2003
Messages
6,423
Something this strange/odd/curious always makes me think of corruption!

Although we usually think of Forms, and even entire Databases, when we speak of corruption, Controls, such as Textboxes, can and do become corrupted, and seem particularly susceptible to this during app development.

The test/cure for this is short and simple...delete and then re-create the Control...which is what I'd try, here. It'll only take half a minute, and if it doesn't work...what have you lost?

Linq ;0)>
 

vagelisr

Registered User.
Local time
Today, 13:18
Joined
Apr 28, 2011
Messages
87
Thanks for your time...

I had already try to crete a new control but i face the same problem.
The field hasn't any extreme properties. Only it is a date and a date mask (99/99/0000;0;_) nothing more nothing less.
Also if the middle field is date i add with dateadd some years with this code
Private Sub W__RELEASEDATE_Exit(Cancel As Integer)
If IsDate(W__RELEASEDATE) Then
If DateDiff("d", W__DATEAPPLICATION, W__RELEASEDATE) < 0 Then
MsgBox "Μη αποδεκτή ημερομηνία. Πρέπει να είναι τουλάχιστον ίση με την " & W__DATEAPPLICATION
Cancel = True
Else
If IsDate(W__RELEASEDATE) And Not IsDate(W__EXPIRYDATE) Then
W__EXPIRYDATE = DateAdd("yyyy", Licence_Renewal, W__RELEASEDATE)
W__EXPIRYDATE.SetFocus
End If
End If
End If
End Sub
 

Tieval

Still Clueless
Local time
Today, 11:18
Joined
Jun 26, 2015
Messages
475
Code:
W__EXPIRYDATE.SetFocus
Is it not just black because it has the focus, click in another field and see if it clears.
 

sneuberg

AWF VIP
Local time
Today, 03:18
Joined
Oct 17, 2014
Messages
3,506
Code:
W__EXPIRYDATE.SetFocus
Is it not just black because it has the focus, click in another field and see if it clears.

vagelisr said

If the specific field lost the focus the date is correct and i am able to see it.

so the question is why is it all black rather than inverted(the date in white) as normally happens when a field is selected, but there is another question and that is

Does anything change if you move the cursor within the field with the arrow keys or by click in the field with the mouse?
 

vagelisr

Registered User.
Local time
Today, 13:18
Joined
Apr 28, 2011
Messages
87
I upload the specific form as you suggest
 

Attachments

  • Test.zip
    2 MB · Views: 57

sneuberg

AWF VIP
Local time
Today, 03:18
Joined
Oct 17, 2014
Messages
3,506
Just wanted to let you know they I'm working on this but I'm fight this



error in about every event procedure. I tried reloading the objects in a copy and upgrading it to .accdb version and yet this persists. I assume this isn't happening to you?
 

Attachments

  • Error.jpg
    Error.jpg
    50.5 KB · Views: 286

vagelisr

Registered User.
Local time
Today, 13:18
Joined
Apr 28, 2011
Messages
87
Thanks again for your time.

No.
When i try to run the only form that access had i'm not face any problem.
I'm sorry but i don't know why this happend.

PS: I use Office 2003!!!!!
 

sneuberg

AWF VIP
Local time
Today, 03:18
Joined
Oct 17, 2014
Messages
3,506
It's looks like the form is corrupt. I created a new form, duplicating the parts where you you are having this problem, and the new form doesn't have this black out problem. I tried compact and repair and that didn't help. Also a decompile did nothing. Then I saved the form as text, i,e., ran
Code:
Application.SaveAsText acForm, "GUN_LICENSE", "C:\GUN_LICENSE.txt"

When I deleted the form and imported the exported text with
Code:
Application.LoadFromText acForm, "GUN_LICENSE", "C:\GUN_LICENSE.txt"

It produced an error and an error.txt file which said:

Microsoft Access encountered an error while importing the object 'GUN_LICENSE'.

Error encountered at line 71.
This property does not apply to this control.


Line 71 is

Code:
NoSaveCTIWhenDisabled =1

when I deleted that line then form imports ok and functions without the blackout but the labels are all buggered. But even if the labels were ok this would be a bad way to fix this.

Sorry but I the only thing I can suggest is to recreate the form although you might try the save as text and load from text first. Maybe you'll have better luck.
 

Users who are viewing this thread

Top Bottom