I am trying to create a pop-up form that a user can use to search for a purchase order. I thought I could use a clone of the recordset for the subform (which contains the desc of items purchased). I don't get any errors, just no record movement on the form. In the debug screen I am verifying that "rst.NoMatch" is set true. But there are indeed matching records.
I have assigned the code to the "On Click" event of a button on a form called "DPO Edit Form" which contains a subform named "DPO Edit Subform". The data source for "DPO Edit Form" is "DPO Header" which contains purchase order information like POnumber, Date, RequesterName, PhoneNumber, etc. The data source for the subform "DPO Edit Subform" is "DPO Detail" which contains the items being purchased - POnumber, Description, UnitOfMeasure, Qty, Cost. These two tables are related by the key field POnumber.
The actual code as it reads in my form is:
Dim frm As Form, rst As Recordset
Set frm = Me![DPO Edit Subform].Form
Set rst = frm.RecordsetClone
rst.FindFirst "[Description] Like 'paint*'"
If Not rst.NoMatch Then
frm.Bookmark = rst.Bookmark
End If
rst.Close
Set rst = Nothing
The "DPO Detail" table contains 12006 records, of which approximately 79 of the Description field begin with the word "Paint".
What am I missing?
--------------------
Second question (provided I can get the first part working), is there a way to provide a pop-up form that would allow the user to enter mulitple criterion that would span BOTH tables. Such as: Find the PO that was created between this date and that date, by Requester so-and-so, that ordered an item description containing the word VALVE, within the price range of $100-$200.
That would really make my day! I've been chewing on this one for 3 months.
Anxiously awaiting any response,
Dan
I have assigned the code to the "On Click" event of a button on a form called "DPO Edit Form" which contains a subform named "DPO Edit Subform". The data source for "DPO Edit Form" is "DPO Header" which contains purchase order information like POnumber, Date, RequesterName, PhoneNumber, etc. The data source for the subform "DPO Edit Subform" is "DPO Detail" which contains the items being purchased - POnumber, Description, UnitOfMeasure, Qty, Cost. These two tables are related by the key field POnumber.
The actual code as it reads in my form is:
Dim frm As Form, rst As Recordset
Set frm = Me![DPO Edit Subform].Form
Set rst = frm.RecordsetClone
rst.FindFirst "[Description] Like 'paint*'"
If Not rst.NoMatch Then
frm.Bookmark = rst.Bookmark
End If
rst.Close
Set rst = Nothing
The "DPO Detail" table contains 12006 records, of which approximately 79 of the Description field begin with the word "Paint".
What am I missing?
--------------------
Second question (provided I can get the first part working), is there a way to provide a pop-up form that would allow the user to enter mulitple criterion that would span BOTH tables. Such as: Find the PO that was created between this date and that date, by Requester so-and-so, that ordered an item description containing the word VALVE, within the price range of $100-$200.
That would really make my day! I've been chewing on this one for 3 months.
Anxiously awaiting any response,
Dan