[AccessD] Bang and Dot operator in Runtimes.

John Skolits askolits at ot.com
Mon Aug 21 21:09:22 CDT 2006


Actually, it is a bound form, but this turns out to be an unbound text box
on the form. So, there is no field named "txtDate", just the text box name.
Therefore, why would the "!" work and not the "."

I could certainly re-design the form, but the reason for posting the
question in the first place is to find out why is this happening anyway.
And I've seen it many times before. Must have something to do with it being
an unbound control. 

John



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Erwin Craps - IT
Helps
Sent: Monday, August 21, 2006 5:44 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Bang and Dot operator in Runtimes.

When using me.txtdate your are refering to the control on a form.
When using me!txtdate you are refering to the field from the forms
recordset (rowsource). 

But for what concerns your error.
When using me.txtDate = #1/1/2001# the code can fails depending of whats
in the controlsource. If you replace the . By a ! Than you maybe have no
error but you are refering tho the field instead of the control (in case
a field exists with that name).




-----Oorspronkelijk bericht-----
Van: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] Namens John Skolits
Verzonden: maandag 21 augustus 2006 21:46
Aan: 'Access Developers discussion and problem solving'
Onderwerp: [AccessD] Bang and Dot operator in Runtimes.


I've been able to fix this by making some changes in code but want to
know if anyone has additional info on why this occurs.

Sometimes, referring to a text box with the "." operator sometimes fails
in runtime apps.

me.txtDate = #1/1/2001#  'Causes an error Vs.
Me!txtDate = #1/1/2001#

The error message I get is that the dot operator is invalid.

I simply change it and it's fine. Yet, on other forms, it's working.

I re-import and uncompile/compile many times on these apps and it still
doesn't seem to always catch the potential problem.

Any thoughts?

John





--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list