requery lookup information

A

Angi

I have a lookup form that displays information based on what is
selected from an unbound combo box (cboLU).

I've added a cmd button (cmdRemove) to the bottom of the form to
delete (make inactive) the current record. It takes the name out of
cboLU, but it doesn't requery the main information. I end up with a
blank in the combo box, but the form stays filled in.

My current code is:

Me.Inactive = True
Me.Dirty = False
Me.cboLU.Requery
Me.Requery

My form source is:
SELECT tblStudent.*, tblStudent.SdtID FROM tblStudent WHERE
(((tblStudent.SdtID)=[Forms]![frmStudentLU]![cboLU]));

I've tried using Me.SdtID.Requery, but that didn't work either. Any
help would be appreciated. TIA
 
D

Dirk Goldgar

Angi said:
I have a lookup form that displays information based on what is
selected from an unbound combo box (cboLU).

I've added a cmd button (cmdRemove) to the bottom of the form to
delete (make inactive) the current record. It takes the name out of
cboLU, but it doesn't requery the main information. I end up with a
blank in the combo box, but the form stays filled in.

My current code is:

Me.Inactive = True
Me.Dirty = False
Me.cboLU.Requery
Me.Requery

My form source is:
SELECT tblStudent.*, tblStudent.SdtID FROM tblStudent WHERE
(((tblStudent.SdtID)=[Forms]![frmStudentLU]![cboLU]));

I've tried using Me.SdtID.Requery, but that didn't work either. Any
help would be appreciated. TIA


I assum the rowsource of cboLU excludes inactive records? I think that you
have requeried cboLU but not cleared its value (which, since it is no longer
in the rowsource, doesn't display). Add the line:

Me.cboLU = Null

before you requery the form.
 
A

Angi

I have a lookup form that displays information based on what is
selected from an unbound combo box (cboLU).
I've added a cmd button (cmdRemove) to the bottom of the form to
delete (make inactive) the current record.  It takes the name out of
cboLU, but it doesn't requery the main information.  I end up with a
blank in the combo box, but the form stays filled in.
My current code is:
   Me.Inactive = True
   Me.Dirty = False
   Me.cboLU.Requery
   Me.Requery
My form source is:
SELECT tblStudent.*, tblStudent.SdtID FROM tblStudent WHERE
(((tblStudent.SdtID)=[Forms]![frmStudentLU]![cboLU]));
I've tried using Me.SdtID.Requery, but that didn't work either.  Any
help would be appreciated.  TIA

I assum the rowsource of cboLU excludes inactive records?  I think thatyou
have requeried cboLU but not cleared its value (which, since it is no longer
in the rowsource, doesn't display).  Add the line:

    Me.cboLU = Null

before you requery the form.

--
Dirk Goldgar, MS Access MVPwww.datagnostics.com

(please reply to the newsgroup)- Hide quoted text -

- Show quoted text -

That was it. Thank you!
 

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