requery combo from another screen

G

Guest

I am re-posting this

I have a small window (frm) that will popup upon user's click on a cmd. Once users done editing the records on the popup and close the popup, I need to refresh the cbo box on the calling frm to reflect user's edit. Some how I can not get the cbo to refresh

On the calling form (i have frm and subfrm, the cmdCat is on the subfrm)

Private Sub cmdCat_Click(
DoCmd.OpenForm "frmCat", , OpenArgs:=Me.Parent.Nam
End Su

on the frmCat popup

Private Sub cmdClose_Click(

If IsNull(Me.OpenArgs) The
DoCmd.Clos
Exit Su
End I

Select Case Me.OpenArg
Case "frmProd
Forms!frmProd!frmSubProd.Form!cboCat.RowSource = "SELECT CatID, Cat FROM tblCat ORDER BY Cat
Forms!frmProd!frmSubProd.Form!cboCat.Requer
' but the cbo box was not refreshed. the user's change was not in the dropdown unless I close the frm and re-open?????
End Selec

DoCmd.Clos
End Su
 
M

MacDermott

I'm guessing that you haven't saved the new record yet before you requery
the combobox.
Try adding
Me.Dirty=False
before you requery the combobox.

HTH
- Turtle


Chris said:
I am re-posting this:

I have a small window (frm) that will popup upon user's click on a cmd.
Once users done editing the records on the popup and close the popup, I need
to refresh the cbo box on the calling frm to reflect user's edit. Some how I
can not get the cbo to refresh?
On the calling form (i have frm and subfrm, the cmdCat is on the subfrm):

Private Sub cmdCat_Click()
DoCmd.OpenForm "frmCat", , OpenArgs:=Me.Parent.Name
End Sub

on the frmCat popup:

Private Sub cmdClose_Click()

If IsNull(Me.OpenArgs) Then
DoCmd.Close
Exit Sub
End If

Select Case Me.OpenArgs
Case "frmProd"
Forms!frmProd!frmSubProd.Form!cboCat.RowSource = "SELECT
CatID, Cat FROM tblCat ORDER BY Cat"
Forms!frmProd!frmSubProd.Form!cboCat.Requery
' but the cbo box was not refreshed. the user's change was not
in the dropdown unless I close the frm and re-open??????
 

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

Top