Cindy K said:
The data type for CustNo is Number. The first column is the bound
column on the combo box. Can it have something to do with the
pointers? I am assuming they are all unchangeable within Access. The
problem does not occur on a regular basis but this form is used alot
during the day and has pointed to the wrong records many times,
enough to hinder production. I can't even get the problem to occur
consistently on a particular record or data entry style. It just
happens as if it forgets what record we are looking for and throws
just anything up. Any ideas?
I'm rather perplexed at the moment. It may be that the form is
corrupted in some way. Is this a split database, with each user having
her own copy of the front-end, or are multiple users opening the same
database file?
If the form is corrupted, you may have to recreate it from scratch.
Before doing that, though, you might try decompiling the database. You
would do this on a copy of the database, not on the original, and then
if all went well you would swap in the copy you worked on.
Here's the general procedure for decompiling:
1. Make sure you have a backup copy!
2. With no users in the database, execute a command line similar to this
via Start -> Run:
msaccess.exe /decompile "C:\Path To\YourDB.mdb"
You may have to specify the full path to msaccess.exe as well.
3. Open the database and compact it.
4. Compile the database (in VB Editor, click Debug -> Compile).
5. Compact the database again.
See if that fixes the problem.
If that *doesn't* fix the problem, you might try to get rid of
corruption by saving the form as text, deleting it, and reloading it,
using the undocumented Application.SaveAsText and .LoadFromText methods.
Here's how:
1. Click Tools -> Options, go to the General tab, and turn off Name
AutoCorrect if it's on.
2. Press Ctrl+G to open the Immediate window.
3. Enter the following command in the Immediate window, substituting
your form's name:
Application.SaveAsText acForm, "YourForm",
"C:\Temp\YourForm.txt"
4. Delete or rename the original form in the database.
5. Enter the following command in the Immediate window, substituting
your form's name:
Application.LoadFromText acForm, "YourForm",
"C:\Temp\YourForm.txt"
5. Recompile your database.
If that doesn't fix the problem, then I think your next step is to
rebuild the form from scratch.