Searching/Modifying/Deleting Records on a Subform

  • Thread starter Thread starter L.A. Lawyer
  • Start date Start date
L

L.A. Lawyer

I want to be to change or delete records on a subform based on whether or
not they contain certain text strings.

How do "search" for the relative records (i.e., the records that contain
certain strings)?

How do I obtain the ItemID from that record?

How do I change the value of one or more fields in that record?

How do I delete the record if that is appropriate?

Thanks!
 
L.A. Lawyer said:
I want to be to change or delete records on a subform based on whether or
not they contain certain text strings.

How do "search" for the relative records (i.e., the records that contain
certain strings)?

How do I obtain the ItemID from that record?

Select the record. Use an event to refer to the ItemID, like:

Sub Form_AfterInsert()
DoCmd.RunCommand acCmdSaveRecord
Debug.Print Me.ItemID
End Sub
How do I change the value of one or more fields in that record?

Put the cursor in the textbox, use the Delete or Backspace key.
How do I delete the record if that is appropriate?

Select the record, and hit the Delete key.
 
I was clearly not clear: I want to do each of these steps programmatically.
How do I programatically obtain the ItemID of a record on the subform by the
content of a field in the record? I then want to replace that with
different text, which will change base on other criteria.
 
I was clearly not clear: I want to do each of these steps programmatically.
How do I programatically obtain the ItemID of a record on the subform by the
content of a field in the record? I then want to replace that with
different text, which will change base on other criteria.

Bear in mind that the Subform *does not contain any data*.

The data is stored in a Table; the subform is only a window, a way to view the
table.

It sounds like you want to run an update query (or a delete query, or
whatever) on that table based on some criteria, and then requery the subform
to display the changed table contents.
 
Back
Top