Programmatically adding records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
(e-mail address removed)
 
Wavequation said:
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?


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).
 
Back
Top