Access JumpStart 2.0 | Blog

A Rapid Development Framework for Microsoft Access

Me: Write a humorous limerick about ChatGPT failing to do what is expected.

ChatGPT:
There once was a bot named ChatGPT,
Whose answers could often betray.
Asked for a rhyme, it stuttered in time,
And left folks in quite the disarray.

It pondered and whirred with great might,
But alas, its response wasn't quite right.
Instead of a joke, it just choked,
Leaving users in fits of plight!

But fear not, dear users, for sure,
ChatGPT's failures are quite the lure.
For in its mistakes, laughter awakes,
And humor, in glitches, finds its allure!

I tried to use ChatGPT today to create some code to concatenate strings together into a VBA variable assignment statement. I was using SQL Server Mangement Studio to generate the CREATE TABLE queries and then plopping that into ChatGPT 3.5 to get it to work.

I have done this successfully in the past many times and it works with a pretty simple prompt like:

I want to represent this query as a quoted string with line continuations for VBA:
<<Paste Query here>>

The problem this time was that my query was about 90 lines long due to a LOT of columns in the table I was creating. So I tried to give it additional prompting to combine the lines into 25 or less to accommodate VBA’s 25 line continuation limit.

This generally resulted in ChatGPT giving me the exact same 90 line query but TELLING me it was only 25 lines. Kinda weird.

So I started giving it prompts to concatenate 4 lines at a time after the word NULL. This really started screwing the query up good. It still did not cut the number of lines at all and instead started adding the word NULL with a comma after it in various places in my query. It did not appear to make any sense where it added them.

Anyway, I told it to remove the extra NULLs and commas and then it spit out something that looked correct. I used it, but it ended up having several of the fields removed and when I inserted it into my database it worked, but I was missing a bunch of columns, so other code relying on those columns broke. I’ve tried since to update the query line breaks myself, but now it keeps inserting NULL, into that query every time, even after I’ve started a new conversation. I even tried to get the system to reset itself by asking it to use the query exactly as I was entering it, but no luck.

So anyway, I’ve had mixed results with ChatGPT. It could be very helpful for a number of things, but sometimes it can be difficult to figure out what prompts to use and even to get back to the original state.

Have you had good experiences with using ChatGPT and VBA code? Let me know.