Results 1 to 9 of 9
  1. #1
    degras is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    72

    A way of finding a specific record

    I want a way of finding a specific invoice record and showing the record on a form, based on an entered invoice number. Note the invoice number is a field on the invoice table. So far I have made a modal dialog where the user can enter a invoice number, but I don't know what to do next or whether this is the right approach.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    many ways:

    the easiest would be to query the table with one param, the invoice number, and bind the form to that qry.

  3. #3
    Rixxe is offline Blessed Bear
    Windows 7 Access 2007
    Join Date
    Sep 2010
    Location
    London (Essex ... yep!)
    Posts
    184
    Edit:
    Or use Adams idea....

  4. #4
    degras is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    72
    Quote Originally Posted by ajetrumpet View Post
    many ways:

    the easiest would be to query the table with one param, the invoice number, and bind the form to that qry.
    The problem with that approach is that I lose the ability to navigate through all the reocrds.

  5. #5
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by degras View Post
    The problem with that approach is that I lose the ability to navigate through all the reocrds.
    then use VBA to filter your form, and turn the filter on and off when you need to.

  6. #6
    degras is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    72
    Quote Originally Posted by ajetrumpet View Post
    then use VBA to filter your form, and turn the filter on and off when you need to.
    OK. Do you know what VBA I need to code in the onclick event of the modal dialog?

    e.g.

    Private Sub CommandOK_Click()
    'How to navigate to record with InvoiceNo=Me.InvoiceNo and show on Invoice2 form?
    End Sub

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The simplest solution might be to use the combo box wizard, choosing the third option, "Find a record...". That is if the form is bound to the invoice table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by degras View Post
    OK. Do you know what VBA I need to code in the onclick event of the modal dialog?

    e.g.

    Private Sub CommandOK_Click()
    'How to navigate to record with InvoiceNo=Me.InvoiceNo and show on Invoice2 form?
    End Sub
    invoice2? as in another form stacked ontop of the search form?

    if not, use Paul's answer. didn't think of that.

  9. #9
    degras is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    72
    Sorted. This is what I used in the OK button on click event:

    DoCmd.OpenForm FormName:="Invoice2", WhereCondition:="[InvoiceNo] = '" & Me!InvoiceNoText & "'"
    DoCmd.Close acForm, Me.Name
    Forms![Invoice2].SetFocus

    I noticed you can turn off the filtering by clicking the button at the bottom of the form.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Print a specific record
    By NISMOJim in forum Forms
    Replies: 5
    Last Post: 01-28-2011, 04:32 PM
  2. specific record output to .pdf
    By REBBROWN in forum Reports
    Replies: 1
    Last Post: 09-25-2010, 07:35 AM
  3. Finding a record
    By Rick West in forum Forms
    Replies: 3
    Last Post: 06-14-2010, 06:39 PM
  4. Text Box to show specific record
    By chu3w in forum Forms
    Replies: 1
    Last Post: 04-01-2010, 12:23 PM
  5. specific record
    By thewabit in forum Access
    Replies: 8
    Last Post: 02-17-2010, 11:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums