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 / May 2007

Tip: Looking for answers? Try searching our database.

Programmatically adding records

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wavequation - 12 May 2007 00:27 GMT
I have a module that adds records to a table, and then must use the new
records for a continuous form.  If I open the form immediately from the
program, there are no records.  If I close the form the module is launched
from, then open the form manually, the records are there.  how can I open the
form from the same module that added the records?  So i guess what I am
asking is how to I force the records to be saved in the table before I open
the form?
Steve - 12 May 2007 01:03 GMT
After you add each record you need to run this code:
DoCmd.RunCommand acCmdSaveRecord

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com

>I have a module that adds records to a table, and then must use the new
> records for a continuous form.  If I open the form immediately from the
[quoted text clipped - 5 lines]
> open
> the form?
Marshall Barton - 12 May 2007 01:32 GMT
>I have a module that adds records to a table, and then must use the new
>records for a continuous form.  If I open the form immediately from the
[quoted text clipped - 3 lines]
>asking is how to I force the records to be saved in the table before I open
>the form?

Requery the form.

BUT you need to make sure that the records additions
completed first.  This is automatic if you use the Execute
method (instead of RunSQL).

Signature

Marsh
MVP [MS Access]

 
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.