Dialog Form

  • Thread starter Thread starter Dom
  • Start date Start date
D

Dom

How can I create a form to prompt me for key information
to find in a table which will display in an underlyign
open form. I am tryign to create a find button which will
bring up a dialog form asking for the desired find
information ie: product name, then find the info from the
table boundto the form that opened the dialog?

I've done this in prior versions of Access but no longer
have accessto those databases to help me in this matter.

help!
 
First you need a Products table that looks like:

TblProduct
ProductID
ProductName
etc

Your underlying form can then be bound to this table or a query based on the
table.

Your find form can then be a small popup form with a combobox based on a query
based on TblProduct sorted by Productname. Your query would include ProductID
and Productname. The bound column of the combobox would be 1, column count 2 and
column widths 0;2. Put the following code in the AfterUpdate event of the
combobox:
Me.Visible = False

Then put this code in the click event of your find button:
Dim Rst As DAO.Recordset
SetRst = Me.RecordsetClone
DoCmd.OpenForm "NameOfFindForm",,,,,acDialog
With Rst
.FindFirst "[ProductID] = " & Forms!NameOfFindForm!NameOfComboboxOnFindForm
Me.BookMark = .Bookmark
.Close
End With
DoCmd.Close acForm, "NameOfFindForm"
Set Rst = Nothing
 
Back
Top