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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find/Search record using listbox and view it in mainform

Status
Not open for further replies.

marjerie888

Technical User
Apr 25, 2005
6
0
0
US
Hi everyone

Need help!I have 2 forms in form2(frmFindQuoteSheet) Im using lisbox to select the record that they want to view in form1(frmQuoteSheetMaster)when I click the cmdFind I'm having an "error runtime error 424"

form1 = frmQuoteSheetMaster
form2 = frmFindQuteSheet

Please anyone can help i'm new in access...Thank u in advance......
----------------------------------------

Private Sub cmdFind_Click()

Dim rst As Object

Set rst = frmQuoteSheetMaster.Form.RecordsetClone
rst.FindFirst "[Placing_ID] = " & "'" & lstFind & "'"
frmQuoteSheetMaster.Form.Bookmark = rst.Bookmark
DoCmd.Close acForm, "frmFindQuoteSheet"

End Sub
 
How are ya marjerie888 . . .

Can't tell if [blue]frmQuoteSheetMaster[/blue] is a subform or not. Please specify!

If it is a subform then you should have:
Code:
[blue]   Dim rst As DAO.Recordset, sfrm As Form
   
   Set sfrm = Forms![purple][b][i]MainFormName[/i][/b][/purple]!frmQuoteSheetMaster.Form
   Set rst = sfrm.RecordsetClone
   
   If rst.BOF Then
      MsgBox "No Records!"
   Else
      rst.FindFirst "[Placing_ID] = " & "'" & lstFind & "'"
      
      If rst.NoMatch Then
         MsgBox "Record Not Found! . . ."
      Else
         sfrm.Bookmark = rst.Bookmark
         DoCmd.Close acForm, "frmFindQuoteSheet"
      End If
   End If[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top