2

The "Me" keyword in Access 2003 has recently started behaving differently. I can no longer refer to Controls within a Form by typing, say: "Me.Combobox1 = " I can, however, still control it by referring to the Form directly by typing "Form1.Controls("Combobox1") = " - This shows that the Control is definitely present on the Form in question.

This is specific to one project, and may be linked to the following question Inconsistent behavior for Me keyword

As in the above question, there are ActiveX controls present in my Database but, even after deletion, the "Me" keyword still retains its strange behaviour.

Can anyone think why this is happening / how to reverse it? Or a way to find out exactly what the "Me" is now referring to?

It's more annoying / time-consuming than anything else...

Thanks

Community
  • 1
  • 1
Jiminy Cricket
  • 1,377
  • 2
  • 15
  • 24
  • Does your code compile? Sometimes autocomplete goes wonky when the code has a compile error. – RubberDuck Apr 30 '14 at 11:39
  • It doesn't any more because all previous Me keywords have stopped working. It did previously. – Jiminy Cricket Apr 30 '14 at 11:45
  • Have you tried [decompiling the database](http://stackoverflow.com/questions/3266542/how-does-one-decompile-and-recompile-a-database-application)? – RubberDuck Apr 30 '14 at 11:47
  • Have you backed up, compacted and repaired and then decompiled? – Fionnuala Apr 30 '14 at 11:47
  • I've just followed a process for decompling I've found online (I've never did this previously). As I'm using Access 2003, I didn't get any confirmation that the decompiling was successful - is this correct? If so, it still won't compile now. – Jiminy Cricket Apr 30 '14 at 12:08
  • Don't you have a variable/fieldcontrol somewhere in your app also called "me" ? Try adding some `debug print me.name` in your forms code. You could also generate the Documentation to a PDF and search it for "me". – iDevlop Apr 30 '14 at 12:12
  • I may be wrong, but I don't think you can actually set Me as a variable? Nothing has came up in my search. – Jiminy Cricket Apr 30 '14 at 12:35
  • To further confuse things, Debug.Print Me.Name returns the name of the form. I've also used Me.Controls(ControlName) with success - This helps a little bit as it's faster than typing the full form name but, ideally, I'd still prefer to use Me.ControlName – Jiminy Cricket Apr 30 '14 at 12:42
  • Although I've found a solution (posted below), do you think this could be a sign of corruption in the database? I might copy the forms and modules to a new project to be safe. – Jiminy Cricket Apr 30 '14 at 13:37

1 Answers1

0

I've solved the problem, but I've got no idea why it's worked.

I have deleted the latest form that I had created (which only contained 3 ComboBoxes - no code). There was nothing special about the form, and nothing was incorrectly labelled as "Me".

Jiminy Cricket
  • 1,377
  • 2
  • 15
  • 24