Requery form from another form

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

Guest

Hi

Having some frustrations with requerying objects from another form!
Would appreciate any help.

I have a form "frmAnecdoteManage" (recordsource of tblStudents)

On this form I have a listbox - lstAnecdotes. This listbox lists the
anecdotes for the student.

There is also a command button to open a new anecdote.

When this command button is clicked another form, "frmAnecdote" (record
source tblAnecdotes) opens so I can enter some data about a student - this is
a new record.

When this form closes I run the following code:

forms![frmAnecdoteManage].requery
forms![frmAnecdoteManage]![lstAnecdotes].requery

However, it doesn't requery!

So, I try:

forms![frmAnecdoteManage]![lstAnecdotes].rowsource="SELECT ......"

but that doesn't work either!

However, when I click the -> next record command on "frmAnecdoteManage" and
then the <-previous record command the list box displays the correct data.

What am I missing here?

Many thanks

Leonard
 
I suspect that the new record has not been saved at the point you are doing
the requery.

Try adding the following code to force the current record on frmAnecdote to
be saved.

If me.Dirty = True then Me.Dirty = False
Forms![frmAnecdoteManage]![lstAnecdotes].Requery


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Back
Top