Access 97 - new records in Linked Tables not appearing in Form

  • Thread starter Thread starter phil cunningham
  • Start date Start date
P

phil cunningham

I have a MDB file that links to tables in a second MDB file. Both are
Access97 format
Within the first MDB there is a Form showing all the records from one of
these linked tables.
I then use VBA from the form to add a new record to the table - this works
exactly as expected

but...
the new record does not appear in the records of the Form - i.e. the last
record available via the form is the one before the new one.

I have tried pressing F9 a few times and eventually the record may appear
I have tried adding the line "DBEngine.Idle dbRefreshCache" after the
record is added by VBA
I've even added some code to Close and Re-open the form in the hope that
this will force it to re-list ALL the records but even this does not work on
its own.
No problem I add the record manually, it is when the record is added
directly to the table via VBA that the form does not pick it up.

This system was originally written in Access 2 and it worked perfectly. The
problem has only started since we converted both MDB files to Access 97.

As a test, I removed the linked tables and actually imported the tables and
the problem disappeared so it has something to do with Linked Tables.

If anyone can help I'd be really appreciative.

Best regards
Phil Cunningham
 
I've tried this but it makes no difference the new record just wont appear.

Do you think record locking may have something to do with it.

Phil
 
phil cunningham said:
I've tried this but it makes no difference the new record just wont appear.

Do you think record locking may have something to do with it.

I doubt it. It's pretty hard to lock a new record. <g> I remember rare
problems when Me.Requery didn't work. In that case we'd have to beat the
code with a bigger hammer:

Me.RecordsSource = Me.RecordsSource

Access thinks you are changing the recordsource and forces a requery. If you
are closing and reopening the form and still can't see the record, it
probably is something pernicious like anti-virus software. Turn off virus
checking and test. If it works, stop letting your AV software check MDB
files.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
A work around found

If I add the records using VBA of the form like
docmd.gotorecord,, acNewRec
me.[contract name]= ....


it works perfectly
but I've not been able to make the old way work i.e. adding records directly
to the underlying table.

Thanks for the ideas though, at least we can make this work now

Phil
 
Back
Top