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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top