John Skolits
askolits at ot.com
Tue Aug 22 13:12:29 CDT 2006
Very interesting. I thought maybe that's why I had my problem, but unfortunately, I had explicit turned on. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust Sent: Tuesday, August 22, 2006 1:58 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Bang and Dot operator in Runtimes. One place where it makes a difference is if you don't have Option Explicit turned on. In that case, not using the Me in referring to an object and misspelling the name of the object will result in the compiler interpreting the item as a variable. If you do have Option Explicit turned on (and we all do, right?), misspelling the name of an object will cause a runtime error telling you the variable wasn't declared. Using the Me gives you a more useful message that it can't find the object. Charlotte Foust -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Skolits Sent: Monday, August 21, 2006 1:51 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Bang and Dot operator in Runtimes. Boy, I kind of feel it's dangerous not to be more explicit when identifying a particular control. I've been using access since it's birth and hardly see any code examples that don't include some type of identifier. Am I losing it or something. Anyone else have any input? -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Monday, August 21, 2006 4:35 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Bang and Dot operator in Runtimes. It's just: txtDate = #1/1/2001# or cboPerson = "Dan Waters" or lblName.Caption = "Full Name" or chkPerson = True Yes - when I use a Wizard to create Report, the controls do get the same names as the fields. So, to make sure I (and Access) know what I'm referring to, I always change the control names so they use a naming convention. I've never come across the need to used .Value - so far anyway! Dan Waters -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Skolits Sent: Monday, August 21, 2006 3:18 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Bang and Dot operator in Runtimes. Gee, I've been doing that since version 1.0. How else do you refer to a control on the form besides using Full syntax? Froms!frmMainForm!txtDate = #1/1/2001# ? Or using a With (which uses the "." operator) With txtDate .Height = 2000 .Width = 2000 .Caption = "This is MyLabel" End With Maybe I should use me.txtDate.Value? But, I've had issues with ".value" in the past. Don't remember what the Issues were but from past experiences I've avoid using .value if I can. As you suggested, you could drop it all together and sometimes it works, but if you have a field name behind the form and a text box name with the same name, it will get confused. John -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters Sent: Monday, August 21, 2006 3:58 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Bang and Dot operator in Runtimes. John, I never use the me. or me! syntax on any forms or reports to simply refer to a textbox, combobox, checkbox, label, etc. Could you just remove it altogether? Dan Waters -----Original Message----- Subject: [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 -- 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 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com