• how to find a record that is a number (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » how to find a record that is a number (Access 2000)

    Author
    Topic
    #367712

    Can somebody help me with the code for finding a record by typing its number.I have a table of products.
    and each product has an unique number.The first Record is called ProductID.What i need is a command aksing me the number of the product (ProductID) and then finding it. I have looked through some examples of FindFirst in the books,but i am afraid they are already obsolete.

    Viewing 2 reply threads
    Author
    Replies
    • #574136

      Assuming your records are in a table, have you tried Edit, Find from the main command bar?

    • #574138

      Assuming you are launching your search from a Form, you could create a parameter query that launches when a form is opened or you press a Command button you create that will ask you for the Unique ID. The Parameter Query would then pass back the data you are looking for.

    • #574139

      I would use a combo box in the header or the footer of the form with the ProductID.
      In the After Update of the Combo box :

      Private Sub cmbProductID_AfterUpdate()
         On Error GoTo PROC_ERR
         DoCmd.GoToControl "ProductID"
         DoCmd.FindRecord cmbProductID, , , acSearchAll, , acCurrent
         Exit Sub
      PROC_ERR:
         MsgBox "There was an error : " & Error$
         Resume Next
      End Sub
      

      This assume you name your combobox cmbProductID, you have a textbox named ProductID on the form.

    Viewing 2 reply threads
    Reply To: how to find a record that is a number (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: