Re: requery lookup information

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Dec 2, 10:14 am, "Dirk Goldgar"
<d...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
"Angi" <an...@xxxxxxx> wrote in message

news:6bf5fca9-57c5-4d46-9d67-2809b76f2aa8@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx





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.

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

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

- Show quoted text -

That was it. Thank you!
.



Relevant Pages

  • Re: requery lookup information
    ... but it doesn't requery the main information. ... SELECT tblStudent.*, tblStudent.SdtID FROM tblStudent WHERE ... 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). ...
    (microsoft.public.access.formscoding)
  • Re: Requerying ComboBox in NotInList event
    ...     Mickey Mouse ... Any attempt to requery the combobox gives me an error that the field ...
    (comp.databases.ms-access)
  • Re: Requerying ComboBox in NotInList event
    ... The way it works for me is typing: ... Your code, minus the Requery, looks correct. ...     Mickey Mouse ...  I get the standard error message that the ...
    (comp.databases.ms-access)
  • Re: Requery Not Working
    ...     If Me.Dirty Then ... This will only requery the form If the record was added to the table. ... Private Sub Command15_Click ... Dim frm As Form ...
    (microsoft.public.access.formscoding)