473,225 Members | 1,058 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

Why is Me. suddenly not Okay?

1,271 Expert 1GB
So, I had this bright idea today that didn't quite work out. Or maybe it is working out but requires me to change a habit. I'm working on a form that will be a sub-form of another form. During initial development, I find it easier or better to work on the form as stand-alone entity rather than a sub-form. One reason is that I can edit the form using the entire screen instead of just that portion of the main form allocated to the sub-form.

Anyway, this sub-form references some objects on the parent form. Those same named objects exist on the sub-form, so I thought why don't I do this:
Expand|Select|Wrap|Line Numbers
  1. dim obj as object
  2. set obj = Me
and then replace this
Expand|Select|Wrap|Line Numbers
  1. me.parent.controlname ...
  2. to
  3. obj.controlname
Then, when I am ready to put the two forms together, all I have to do is change
Expand|Select|Wrap|Line Numbers
  1. set obj = me
  2. to
  3. set obj = me.parent
Voila, all good, right? Well, the weirdest thing happened. Suddenly, I got compile errors in both the main form and sub-form. The compiler was telling me that object names didn't exist that I knew darn well existed. I have been running the main form for several days.

I tried this experiment. I changed an object name from "Salesman_filter" to "Tsalesman_filter", and I changed my code from Me.Salesman_filter to Me.Tsalesman_filter, and then the compiler was happy. The compile error was now reported a few lines further down on a reference to another object. I changed Tsalesman_filter back to Salesman_filter and the compiler was still happy with the Me. reference, but still unhappy with the following reference to a different object.

So very weird. Then I tried changing the Me. references to Me! references, and the compiler stopped seeing an error. I changed all my Me. references to Me! references and no more errors.

What in the world happened? Can any of you explain this?

Thanks!
Jan 12 '24 #1
3 23046
NeoPa
32,554 Expert Mod 16PB
Hi Jim.

I'm not sure your explanation paints a very clear picture of the situation you're in. Do you have a minimalised (Remove everything except items germane to the issue) version you could possibly Zip & attach. I suspect I'll also require some straightforward instructions detailing precisely what you did; in which order; what results you saw at each stage.

I can say that your description doesn't match any expectation I'd have, regardless of how I interpreted what you've said. Nothing comes to mind at all at this point. However, I'm happy to look into it in more detail once I have a clear understanding of what I need to focus on.

It may be helpful also, to include information from Colin's Access/Windows/Office365 Version Checker. I have access only to 2019 ATM so anything that needs a version later than that will keep me from investigating further. Very unlikely of course.
Jan 12 '24 #2
jimatqsi
1,271 Expert 1GB
NeoPa,
I'm sorry I have not gotten back to this yet. I appreciate your interest in helping. I did fail to mention in my post that I have tried decompiling and recompiling, as well as Compact and Repair. I have backups that I can use to, presumably, repeat the process and see if the issue follows suit.

However, at the moment other issues are more pressing. The code my post refers to is part of a project for the not too distant future, but not today. I do want to understand what happened, so I will return to this, and hopefully, soon.

The question about version is certainly relevant. I've got a developer's license and the details are
MS 365 Apps for Enterprise
Version 2312 (Build 17126.20132 Click to Run)
Current Channel

Otherwise, I have reread my post and don't see anything I would change, except those steps I performed but didn't mention. I mean the post describes pretty well the sequence of events as I remember them.

I'd have to import some local data and change some links before I could hope to make a shareable database. I may yet do that, because I'd like for someone else to see this.

I will try to reproduce this and post an update.

Thanks for your interest!
Jan 16 '24 #3
NeoPa
32,554 Expert Mod 16PB
Hi Jim.

There's no rush. I hover & monitor most of the time but I can't promise I'll be able to throw much light on this. From what I understand this isn't behaviour I'd expect. Being able to reproduce your steps exactly would certainly help when you get to that stage, but I'll look at whatever you have. No promises even if you made a video showing all your steps exactly, but generally the more accurately I follow in your footsteps the higher the chance there is of me being able to help.

I'm also only able to test within 2019 ATM, so if it's the result of a recent update then I probably won't even get to see it.

You do what you can & I'll do what I can, and I hope we can manage to find something between the two of us :-)
Jan 16 '24 #4

Sign in to post your reply or Sign up for a free account.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.