C
Curiousmark
I use a subform to display a list in continous format. When the main form
("frmEncoutner") opens, I want the subform ("subfrmCaseHistory") to display
the last 11 records in the list (it is sorted in chronological order with the
most recent at the bottom), so I use the following commands in the subform
"Form_Open" event:
DoCmd.GoToRecord , , acLast
DoCmd.GoToRecord , , acPrevious, 11
When the user adds data using the main form and enters it, I want the
subform to update with the newest data. I use the requery command in an
application module:
Forms!frmEncounter![Case History].Requery
This works fine, but I can't get the subform to display the last 11 entries.
I've tried using the GoToRecord commands in the subform's DataChange event,
but that doesn't work. I've tried using it in the application module but
can't figure out how to refer to the subform.
For example, if I try:
DoCmd.GoToRecord acDataForm, "Forms!frmEncounter!subfrmCaseHistory",
acLast
DoCmd.GoToRecord acDataForm, "Forms!frmEncounter!subfrmCaseHistory",
acPrevious, 11
No matter what syntax I try, I get the error:
The object "Forms!frmEncounter!subfrmCaseHistory" isn't open.
I've tried every way I can think of to refer to the subform, but get the
same error that the subform isn't open.
Any suggestions?
("frmEncoutner") opens, I want the subform ("subfrmCaseHistory") to display
the last 11 records in the list (it is sorted in chronological order with the
most recent at the bottom), so I use the following commands in the subform
"Form_Open" event:
DoCmd.GoToRecord , , acLast
DoCmd.GoToRecord , , acPrevious, 11
When the user adds data using the main form and enters it, I want the
subform to update with the newest data. I use the requery command in an
application module:
Forms!frmEncounter![Case History].Requery
This works fine, but I can't get the subform to display the last 11 entries.
I've tried using the GoToRecord commands in the subform's DataChange event,
but that doesn't work. I've tried using it in the application module but
can't figure out how to refer to the subform.
For example, if I try:
DoCmd.GoToRecord acDataForm, "Forms!frmEncounter!subfrmCaseHistory",
acLast
DoCmd.GoToRecord acDataForm, "Forms!frmEncounter!subfrmCaseHistory",
acPrevious, 11
No matter what syntax I try, I get the error:
The object "Forms!frmEncounter!subfrmCaseHistory" isn't open.
I've tried every way I can think of to refer to the subform, but get the
same error that the subform isn't open.
Any suggestions?