Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Bang! v Dot.    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
ChatGPT Madness
Lars Schindler 
     
11 months ago
I was just about to have my code proofread by ChatGPT.
On this occasion, ChatGPT once again turned datStart (a text field in my form) into Me.datStart in the VBA code.
I asked him why he changed datStart to Me.datStart.
ChatGPT insisted that the spelling with Me. is standard.
Okay, ChatGPT also hallucinated, after I referred him to Richard's video ‘Bang! v Dot.’, that Richard was of the same opinion...

In short:
Does this also happen to you with ChatGPT?
And if so, how do you deal with it?
Should this be addressed directly in prompts to ChatGPT?
Richard Rost  @Reply  
          
11 months ago
So very interesting comment. I just took the transcript of that video and asked ChatGPT to summarize it and tell me whether or not I was correct. And here's what it said:

Summary of the Transcript:

In this video, the instructor (Richard Rost) explains the difference between the bang (`!`) and dot (`.`) operators in Microsoft Access VBA.

Key Points:

* Dot (`.`) Operator:
  Used to access properties and methods of an object.
  Example: `Me.Caption` or `DoCmd.OpenForm`

* Bang (`!`) Operator:
  Used to reference a member of a collection, such as a control or field in a form.
  Example: `Me!FirstName` is the preferred way to refer to a text box named `FirstName`.

* Why `Me.FirstName` sometimes works:
  Access auto-promotes control names to properties at runtime for convenience.
  This behavior is not reliable and can break under certain conditions.

* When `Me.FirstName` breaks:

  1. When field/control names are reserved words (e.g., `Name`, `Caption`, `Picture`)
  2. When the RecordSource of the form changes dynamically in code and no longer includes the field
  3. When the field is missing or misnamed

* Recommendation:
  Use `Me!FieldName` for controls and fields to avoid ambiguity and runtime errors.
  Use `Me.PropertyName` only for actual properties (like `Me.Width` or `Me.Caption`).

* Other tips:

  * You can omit `Me` entirely when referencing controls on the current form.
  * To access fields on other forms or subforms, use explicit references with `Forms("FormName")!FieldName` or similar.

Is the author correct?

Yes, Richard is absolutely correct.
His explanation aligns with how VBA and the Access object model work. The distinction between the dot (for properties/methods) and bang (for members of collections like controls or fields) is well-documented. He also correctly highlights why relying on Access's automatic promotion of control names to properties is risky and can lead to hard-to-debug issues.
Richard Rost  @Reply  
          
11 months ago
And then I specifically told it about your question, and here's what it had to say:

Yes, your student is exactly right to question that behavior  -  and yes, ChatGPT does often default to using `Me.` notation in examples involving form controls. This happens for a few reasons:

Why ChatGPT Adds `Me.` by Default:

1. Microsoft's own documentation frequently uses `Me.` when referring to form controls, which influences AI training data.
2. In other object-oriented programming languages, prefixing properties/methods with `this.` (like `Me.` in VBA) is standard practice, so the model tends to carry that over.
3. `Me.` gives IntelliSense suggestions, which some developers like  -  but that doesn't mean it's always correct or reliable in Access.

What Actually Happens:

* When ChatGPT writes `Me.datStart`, it's assuming `datStart` is either a property or a promoted control.
* As you correctly explain in your video, this works sometimes, but not always  -  especially with reserved words or dynamic record sources.
* If a student refers the model to your video and it still insists that `Me.datStart` is standard, that's a clear hallucination or overgeneralization from broader training data.

How to Fix This with Prompts:

Yes, it should absolutely be addressed in the prompt. I recommend something like this:

CodePlease write Access VBA using the bang (!) operator to reference form fields, not the dot (.) operator. For example, use Me!datStart instead of Me.datStart. Avoid assuming control names are promoted to properties. Follow Richard Rost's best practices.


You can also clarify further:

CodeDo not use Me.datStart or Me.txtName. Use Me!datStart and Me!txtName instead. Dot notation is only for actual object properties like Me.Caption or Me.Width.


Final Thoughts:

This is a classic case where ChatGPT's general-purpose training conflicts with best practices in a niche tool like Access. It can absolutely be managed with clearer prompting, and students should understand that Access is quirky and requires its own idioms, which you've clearly explained in your teaching.
Richard Rost  @Reply  
          
11 months ago
You might have to specify your standards if it does stuff that you don't like. For example, whenever I ask GPT to generate code for me, it likes to put all the Dim variable declarations on separate lines, which makes your code extremely long. So it will do stuff like this:

Dim FirstName as String
Dim LastName as String
Dim Phone as String


And so I have in my standard instructions to try to put at least three or four per line to make the code shorter.

Dim FirstName as String, LastName as String, Phone as String

And those are just the little tweaks sometimes that you have to do to work with GPT. It's got its own set of knowledge that it was trained on. Honestly, sometimes that knowledge is wrong. I've come across a lot of things I've found on other websites that are Microsoft Access related and I've had to tell GPT, "No, that's not correct" because it only knows what it's been taught, and if it's been taught wrong stuff, that's what it's going to spit back out.

But I've also had situations where I've messed with GPT and told it "no, that's not right," and then it agrees with me even though I'm wrong. I've done that intentionally a few times. So it can be overly agreeable too. That's why it's always good to verify your sources with something other than GPT. Go back to a classic Google search.

Man, that sounds old right? Go all the way back to 2018 and do a Google search. Go back to 1998 and pull that Access Bible off the shelf.

Next thing I'm gonna know you're gonna be looking in the encyclopedia for stuff.

Richard Rost  @Reply  
          
11 months ago
One of the nice things about ChatGPT is it usually will remember your preferences. I say "usually" because I've told it to do things like I hate em-dashes. And I can't even put one here for you to see because I've specifically programmed the website to filter them out and replace them with hyphens. LOL

I don't like them in my writing at all. I will often dictate either a blog post I want to make or an article I want to write, and I don't worry about spelling and grammar while I'm doing it and getting my thoughts out. Then I'll go back and edit and clean it up for spelling and grammar.

So I'll take my text, copy and paste it in a GPT, and say "Please clean this up for me, spelling and grammar, make sure it reads right." It always inserts semicolons and em-dashes. Semicolons I don't mind so much, but em-dashes I hate - they're big and obtrusive. If anything, use the little hyphen. I know it's grammatically not correct, but that's my personal preference. But it keeps forgetting that and it keeps inserting those damn em-dashes all the time even though I've told it a million times and it's in my system instructions - don't use em-dashes.

So ChatGPT is a great tool and I use it a lot, but it still has a long way to go still.
Richard Rost  @Reply  
          
11 months ago

Richard Rost  @Reply  
          
11 months ago
^ That's an em-dash. They're ugly.
Richard Rost  @Reply  
          
11 months ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Bang! v Dot..
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/30/2026 2:18:58 AM. PLT: 1s