Windows 10 Anniversary update and Office 2016 (1 Viewer)

MackMan

Registered User.
Local time
Today, 00:20
Joined
Nov 25, 2014
Messages
174
Hi all. I've been racking my brain for this for the last couple of hours...

A simple function to find the first day of this month when a form opens..i.e

Code:
me.txtstartdate = dateserial(year(date),Month(date),1)
Should work fine, and it does on another form that was written pre anniversary update for Win10

However, on a new form created POST anniversary update, I've put the above code on a form_load event and I get

Run-Time error '438';
Object does support this property or method.

In break mode typing, ?date in the immediate window shows exactly the same run-time error.
?cdbl(date()) in the immediate window and I get argument not optional.
However, if I type in ?date or ?cdbl(date()) in the immediate window while I'm not in break mode, I get todays date, and serial number respectively.

I've checked settings on Win 10 regional (to see if it's been changed during the update) and they're all fine.

I've checked textbox formatting and it's exactly the same as the textbox that works.

I've even created a new form, and re written the code for new controls and I still get the error.

Yet, this code is working perfectly on another form.

Anyone else has this problem, or have I overlooked something totally obvious?
 

Attachments

  • breakmode.jpg
    breakmode.jpg
    35.9 KB · Views: 183
  • error438.jpg
    error438.jpg
    22.4 KB · Views: 187
  • outofbreak.jpg
    outofbreak.jpg
    11.1 KB · Views: 167

RuralGuy

AWF VIP
Local time
Yesterday, 18:20
Joined
Jul 2, 2005
Messages
13,826
Do a global search on " DATE(". It sounds like you may have created another function called "DATE".
 

RuralGuy

AWF VIP
Local time
Yesterday, 18:20
Joined
Jul 2, 2005
Messages
13,826
My guess is it is in the current FORM.
 

sneuberg

AWF VIP
Local time
Yesterday, 17:20
Joined
Oct 17, 2014
Messages
3,506
What do you get if you comment out the line and just have a msgbox display it like

Code:
'me.txtstartdate = dateserial(year(date),Month(date),1)
msgbox dateserial(year(date),Month(date),1)
 

sneuberg

AWF VIP
Local time
Yesterday, 17:20
Joined
Oct 17, 2014
Messages
3,506
I just gave a command button the name txtstartdate and then put

Code:
me.txtstartdate = dateserial(year(date),Month(date),1)

in the Form load event and got the 438 error. For some reason Access doesn't think a value can be assigned to txtstartdate as though it weren't a textbox or combo box. Are you sure it is?

Edit: On the other hand this experiment doesn't give me the same results you were getting in the Immediate window
 
Last edited:

sneuberg

AWF VIP
Local time
Yesterday, 17:20
Joined
Oct 17, 2014
Messages
3,506
Do a global search on " DATE(". It sounds like you may have created another function called "DATE".
How do you do that? My version of Access (Access 2013) gives me a syntax error when I try to create a function named Date, DATE, or Date. Also CDate results in the syntax error. ADate, BDate, DDate, etc work fine.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 00:20
Joined
Jul 9, 2003
Messages
16,245
Try:-

Code:
me.txtstartdate.Value = dateserial(year(date),Month(date),1)

Sent from my SM-G925F using Tapatalk
 

MackMan

Registered User.
Local time
Today, 00:20
Joined
Nov 25, 2014
Messages
174
Well, definitely no other functions called Date, and only reference the date itself across the whole project so I know I'm good there Allan.
Message box gives me the same error Sneu and on any other new form I create.

Sadly no go Unc on the
Code:
.value
.

So I tried the same form on my laptop and it works perfectly (no windows 10 anniversary update) , so somewhere along the line there is a setting that was changed in regards to the date format in windows(only thing I can think of) but I'm confused as to why this code works on other forms (as mentioned I have a couple of forms that use exactly the same code) and other machines.

Odd behaviour. So this morning, I rolled back the update, and the same code which failed now works perfectly on the same machine this morning.

Have reported to MS via Feedback hub. but... I'm scrutinising windows settings with a fine toothed comb and will ignore the anniversary update for the time being.

Thanks for the input. As always appreciated.
 

jdraw

Super Moderator
Staff member
Local time
Yesterday, 20:20
Joined
Jan 23, 2006
Messages
15,364
I'm not using Office 2016, but do have latest updates for Win 10 with Acc/Office 2013 32 bit.
Using form OnLoad event
Code:
Private Sub Form_Load()
Me.txtStartDate = DateSerial(Year(Date), Month(Date), 1)
End Sub
Works as expected.

reread your latest post and see it
?? must be Office 2016 related??
 

MackMan

Registered User.
Local time
Today, 00:20
Joined
Nov 25, 2014
Messages
174
Form failed after win 10 update yet worked fine on a laptop running windows 10 without update and running Off' 2016. Rolled back the update on the machine it failed on and worked fine again. Rightly or wrongly, I've think it was an error with the windows update itself. I know Off' 2016 is buggy (the most inconvenient being table creation and number formatting) but I didn't think this could be related. We shall see
 

Users who are viewing this thread

Top Bottom