Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search in Sub Form 1

Status
Not open for further replies.

tayyabakashif

Technical User
Joined
Feb 28, 2004
Messages
17
Location
PK
i have orders form in that i have subform ordersdetail Like """Northwind""".
My Question is that i want to Search in OrdersDetail.
i have a combobox SearchOrderDetail.i have my codes in that combo Box.My Sub Form ordersdetail has a Field Code.
i want when i click on the SearchOrderDetail Combo Box.After that if there is somematching goes to Record in SubForm if there is no Record then it's pop-up message.
Any Help

 
Hi

You need to use the .recordsetclone property of the subform

Assuming your combo is on the mainform, something like

With Me.SubFormCONTROLName.Form.RecordsetClone
.FindFirst "YourColName = " & cboYourComboName
'.FindFirst "YourColName = '" & cboYourComboName & "'"
If .NoMAtch Then
Else
Me.SubFormCONTROLName.Form.Bookmark = .Bookmark
End if
End With

Note if it is a string you are seaching for, you need the line as per the commented line with '


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hello Dear Ken Reangy
i am trying this but it gives us a message that the property is not for this object.
where i am wrong.
i give you some detail.i have main form invoice.
main form name is invoice
subform name is vitemtab.
combobox name is cbo
in subform the controlfield name is vcode1.

With Me!vitemtab.vcode1.Form.RecordsetClone
.FindFirst "vcode1 = " & cbo

If .NoMAtch Then
msgbox "no records"
Else
Me!vitemtab.vcode1.Form.Bookmark = .Bookmark
End If
End With
need help to create
 
Hi

I am in UK probably in different timezone to you, so sorry for delay... in my original post I said ".recordsetclone property of the subform", you do not need the control name vCode1, which according to your description is not even present in the main form,....try

With Me!vitemtab.Form.RecordsetClone

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thanks Ken Reay.
my problem has solved.
i check your website here i download your db.for 97.
i want to open in office xp is there any way
 
But it gives message that it can not be convertable.
what i have to do
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top