Access 2010/Visual basic

Stev

New member
Local time
Today, 09:19
Joined
Mar 18, 2015
Messages
5
Help please,

The following Run-time error keeps coming up when I try to run reports on my Access database (also see attached file).

Run-time error '2104':

You entered the control name 'XXXXXXXX,' which is already in use.

When I click on debug and change the control name (Text.box), the same 2104 error message comes up again. The control name is not already in use somewhere else. No underscores were used in the changing of the name either.

I have tried doing this on different computers on the network and have tried running the reports from archived Access databases that have not been changed since before this issue came up (which I assume rules out the database being corrupted). No changes have been made to the script, so basically this is so far an unexplainable problem.

I have tried the compact & repair which makes no difference either.

The so called IT Helpdsk where I work have no clue whatsoever.

Any diagnoses is greatly appreciated.
 

Attachments

  • runtime error 2104.PNG
    runtime error 2104.PNG
    28.4 KB · Views: 88
I am very, very sorry. I am completely new to this.
 
is the control name a reserved word?

Yes, the error comes up for reserved words.
So for one of the instances it says

'Report........' is already in use.

So I change it to 'Report........1' and do similar changes to all the others.

I run it again and it then says 'Report........1' is already in use.
 
next question is what are you actually doing? Please post your code.
 
next question is what are you actually doing? Please post your code.

Please see the attached file where I have copied in the code.

It is used to produced reports from a load of tables within 1 Access database.

I would copy the whole Database across, but as I work in a hospital it contains confidential patient data.
 

Attachments

Ouch - very difficult to read. Please repost suitably indented and also highlight which row the error occurs
 
Ouch - very difficult to read. Please repost suitably indented and also highlight which row the error occurs

Sorry, I just simply copy and pasted it straight from VBA.

Basically every TextBox.Name brings up the Run-time error '2104': message.

Changing the name slightly does not work. In doing do it brings up loads of another message (please see attached snippet).
 

Attachments

still difficult to read, but I can't see where you have declared Textbox as a control. You also aught to have Option Explicit at top of the module (below
Option Compare Database).

Since the problem is with the name, it is not helpful to hide it - the first instance should be producing the name 'indexward21' - does this already exist in the report as any type of control?
 

Users who are viewing this thread

Back
Top Bottom