Results 1 to 2 of 2
  1. #1
    bertenbert is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2008
    Location
    Antwerp
    Posts
    2

    Angry Customize button "goto last record"

    Hello everybody,

    I have created a database for my wife so she can make invoices.

    I have:

    - table: in which all invoices are numbered as follows:

    GF1
    GF2
    GF3
    GF4
    PF1
    PF2

    GF stands for regular invoice and PF stands for pro forma.

    - query based on table



    - form based on query:

    On this form I have the button "record navigation" "goto last record".

    When my wife pushes the button, the button returns invoive PF2

    Now I would like to create two buttons:

    1) a button which returns the last GF invoice

    2) a button which returns the last PF invoice

    Instead of one button which always returns the last invoice, being a PF invoice.

    The goal is thus to customize the VB-code like:

    "goto last record which looks like PF.."

    Hope I was clear in my question.

    Thanks already


  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Code:
    Private Sub Command0_Click()
        me.invoiceNo.setfocus
        DoCmd.FindRecord dmax("invoiceNO","myTable","invoiceNo<'P'")
    End Sub
    Private Sub Command1_Click()
        me.invoiceNo.setfocus
        DoCmd.FindRecord dmax("invoiceNO","myTable","invoiceNo<'P'")
    End Sub
    table name: mytable
    invoiceNo is the textbox in the form for invoice number.

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

Similar Threads

  1. Lock Record when "Add" button is pressed
    By jo15765 in forum Access
    Replies: 34
    Last Post: 11-28-2010, 08:50 PM
  2. Replies: 3
    Last Post: 08-10-2010, 02:12 PM
  3. Replies: 3
    Last Post: 02-23-2010, 06:32 PM
  4. Create "reset filter" button
    By vanlanjl in forum Access
    Replies: 0
    Last Post: 03-03-2009, 07:36 AM
  5. "Previous Month" button
    By allochthonous in forum Programming
    Replies: 3
    Last Post: 09-10-2006, 12:15 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