# "The memory could not be read" in Excel



## cherry_?! (Mar 11, 2005)

I have an Excel spreadsheet that is going to be used as an entry form and will later update an Access data base (right now it is not linked). After having the user set some default values, they use an entry line made up of text boxes and combo boxes to enter information. They click on an "Update" button and that information is validated and copied to a range of cell's that are protected (records can only be edited in the entry line, not in the display cell range). The records are validated and updated through the use of VBA functions. 

The problem I am running into, is that after adding a few records, I receive the following error message: The instruction at "0x6003fbc7" referenced memory at "0x00000038". The memory could not be "read".

Any ideas what could be causing this?

(I am running on a Intel(R) Pentium(R)M with 512 MB of RAM)

The help is much appreciated.
Cherry


----------



## cherry_?! (Mar 11, 2005)

I believe I have found where it is happening in the code, but still not why. I have the KeyDown event evaluating whether it was the tab or enter key being depressed and if so moving to the next field, except with the last field it was prompting the user to add the record and then running the Add routine. If this last tab only prompts a message and the user manually clicks the Add button to call the routine, it no longer gives this error.

I would like to automatically Add the record after the last tab.. Does anyone have any idea how I could avoid this error?


----------



## asbo (Sep 21, 2001)

I haven't used VBA a whole lot, but is a there a LostFocus event that you could use?


----------



## cherry_?! (Mar 11, 2005)

Okay,I just tried that and it is still causing an error. The thing that I find really weird is that if I click a button that calls the function it works fine. 

Any other ideas?


----------



## asbo (Sep 21, 2001)

Hmm. At that point, it might very well be a bug in Excel itself .. Microsoft doesn't always put out 100% perfect stuff, you know


----------



## cherry_?! (Mar 11, 2005)

Well, that is a possiblity for sure. 

Thanks for the thought anyway.


----------

