Remove Rows in a List Box after fields are updated

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

Guest

I have a form that I use to automatically list specific fields in a list box
that need to be updated at a later date. Two text boxes are used to enter the
data in and then are updated by clicking a command button. I need two things
to occur when this process is complete, automatically update the fields in
the list box and remove the row automatically once it has been updated. With
my time constraints I do not want to write code, if possible. However, if
their is no other way to accomplish this task let me know.

Sincerely,
James E
 
? Once the data is entered thru the text boxes, is that the critieria that
will eliminate them from the list box? If yes, then perhaps a
Me.NameOfListBox.Requery on the OnExit of the text box that has been updated
will accomplish what you need?

By requerying the list box, if that is the criteria in query then it should
disappear from view.
 
The criteria I have set up in the query is what automatically populates the
list box. From this point I was not sure how to eliminate the row after it is
updated. Once I enter the information into the text boxes should I use a
go-to-next-record command button for updating all the records, or just set up
an enter command button to this. And, should I put the expression you
provided in one of these command buttons, or on the exit command button?
 
I may have misunderstood, so I might not get this right but here it goes...

The crieria populates the list box... what criteria removes the item from
the list box? I thought adding the date did that but I guess that was
wrong. Let's see if I can explain what I mean so that it makes sense, to me
anyway. Using example below:

List box Text Box
Name Hire Date Term Date Enter Term Date

Query has the criteria set to NOT show on list (on list box) if Term Date is
entered.

You would place Me.NameOfListBox.Requery in Design View,
Properties...scroll down to On Exit and when the list box requeried the one
whose record you just entered the Term Date for would no longer show on the
list. No command button needed. If you wanted to go to the next record,
just type Me.NameOfListBox.SetFocus under the Me.NameOfListBox.Requery and
the cursor would go back to the first record in the list box (no command
button needed for that either).
 
The only thing I did was set the date in the primary field I wanted to show
up on the form was to put <=Now() to have a specific set of records show up
in the list box. All other methods I tried to accomplish the additional tasks
failed. I will try this and see if it will work. Thanks so much for your help!
 
Gina:
I think you are very close to providing me with what I need. I tried to set
the criteria for Actual Declassification Date with the statement you
provided, "NOT show on list (on list box) if Term Date is entered", but it
did not like the syntax. If I use the Me.NameOfListBox.Requery expression do
I enter it in the list box properties in design view? If you could be more
specific I would really appreciate it.
 
I'm not sure what you entered for criteria but I use: Not IsNull

As for the Me.NameOfListBox.Requery you place that on the OnExit of the
form the ListBox is attached to. (However, the list box should NOT be on
the subform of the main form but on the main form.)
 
Oops, I forgot or you can put the Me.NameOfListBox.Requery on the OnExit
of the of the TermDate field.
 
Back
Top