search combo and tab control

  • Thread starter Thread starter george
  • Start date Start date
G

george

Hi to all,

On my Clients form I had a combo box, cboClientSearch,
which I used to locate a specific client. In its
AfterUpdate event I had the following code which worked
fine,

Private Sub cboClientSearch_AfterUpdate()

Dim rs As Object
Set rs = Me.Recordset.Clone
rs.findfirst "[ClientID] = " & str(Nz(Me! _
cboClientSearch], 0))

If Not rs.EOF Then Me.Bookmark = rs.Bookmark

End Sub

Now I have introduced a Tab control in the detail section
of my Clients form and I have moved all Client Info on the
first page of the Tab Control. The cboClientSearch remains
on the detail section but outside the Tab control and...
it no longer works! I get the following error message,

"The expression After Update you entered as the event
property setting produced the following error: A problem
occured while Microsoft Office Access was communicating
with the OLE server or ActiveX Control."

Can someone please give me a clue how to overcome this
problem? I have never used tab controls before and I'm not
sure were to start

Thanks a lot in advance, george
 
The code needs no change due to the tab control, so it looks like a
corruption of the database (unless something has been renamed, or references
have been changed).

To fix it:
1. Decompile a copy of the database by entering something like this at the
command prompt while Access is not running. It is all one line, and include
the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

2. Uncheck the Name Autocorrect boxes under:
Tools | Options | General
Explanation of why:
http://members.iinet.net.au/~allenbrowne/bug-03.html

3. Compact the database.


If the problem still persists, get Access to recreate the database for you
by following the steps for the first symptom in this article:
Recovering from Corruption
at:
http://members.iinet.net.au/~allenbrowne/ser-47.html
 
Back
Top