Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Retrieve data from table using VBA (2003)

    I need to retrieve data from an access table using VBA. I have a switchboard form, using the Switchboard Manager, on which I need to see the last date a transaction was performed. The date is, of course, stored in an Access table. I need to find the last record in that table, pull the date from this record, and display it on the switchboard. I'm new to VBA (hey, I was good at dBase II, but that was a while ago), so be gentle! I know I'll likely need to assign the value when the form loads. Could someone please step me through the code?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Retrieve data from table using VBA (2003)

    You may not need VBA to do this. Say that your table is named tblTransactions, and that the relevant date field is named TransactionDate.
    Place a text box on your switchboard form. Set its Control Source to
    =DMax("TransactionDate","tblTransactions")
    Set the Locked properry of the text box to Yes and itsEnabled property to No, and format it the way you like.

  3. #3
    Lounger
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Retrieve data from table using VBA (2003)

    You're an absolute miracle worker! Works great! Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •