Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / July 2007

Tip: Looking for answers? Try searching our database.

After Adding New Records

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sarah - 12 Jul 2007 19:06 GMT
In VB code I open a table which has records in it and add new records to this
table.  After I've completed adding the new records, I go to the last record
in the table (movelast) and I get an error message - invalid use of null.

Anybody have an idea what's going on?

Thanks,

Sarah
SteveM - 12 Jul 2007 21:42 GMT
Can you post your code?

Steve

> In VB code I open a table which has records in it and add new records to this
> table.  After I've completed adding the new records, I go to the last record
[quoted text clipped - 5 lines]
>
> Sarah
Sarah - 13 Jul 2007 15:32 GMT
Do While (Not (MyTable.EOF))
       If IsNull(MyTable!SeqNo) Then
           MyTable.Edit
           MyTable!SeqNo = k + 1
           k = k + 1
           MyTable.Update
       Else
           k = MyTable!SeqNo
       End If
       MyTable.MoveNext
   Loop
   MyTable.MoveLast

> Can you post your code?
>
[quoted text clipped - 9 lines]
> >
> > Sarah
Sarah - 13 Jul 2007 20:44 GMT
I figured it out.  I did a delete query to the table I was adding new records
to before I added the new records and apparently the table was not getting
refreshed after the delete.  So the code was looking at deleted records that
were not removed from the table.

> Can you post your code?
>
[quoted text clipped - 9 lines]
> >
> > Sarah
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.