Results 1 to 4 of 4
  1. #1
    tobyccdata is offline Novice
    Windows 8 Access 2016
    Join Date
    Aug 2017
    Posts
    2

    Automate form aspect

    Hi everyone, I need help with a project I am working on for a new job. Only been using Access for two days.
    I have been asked to create a database where we can input payment processing.
    One requirement is that when we input a transaction that the bank batch field populates.
    The bank batch field is in a separate table and is an auto generated number. However, my problem is that in any one day we need to use three different batch numbers, so for instance the table will be –


    Batch Number Type
    348 Cash
    349 Credit Card
    350 Cheque
    351 Cash
    352 Cheque
    353 Cheque
    Now I have a form that creates the batch number when needed.
    When my problem lies here:
    The user opens a form to input the financial data. From a drop down menu they select the payment type, from this I want the batch number to automatically come up with the last record in the table that matches.
    So they may select ‘Cheque’ and I want Batch Number = 353
    Please advise on how this can be accomplished.
    I don’t have knowledge on writing code but I am starting to learn.
    Thank you Toby.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Could use DMax() domain aggregate function. Search Access Help or Google for info on using domain aggregate functions.

    Something like:

    Me.tbxBatchNum = DMax("[Batch Number]", "tablename", "[Type]='" & Me.cbxType & "'")


    In your example, should 352 be Credit Card?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    tobyccdata is offline Novice
    Windows 8 Access 2016
    Join Date
    Aug 2017
    Posts
    2
    Sorry i will fix it

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

Similar Threads

  1. Replies: 2
    Last Post: 04-24-2016, 03:10 PM
  2. Replies: 8
    Last Post: 01-30-2014, 05:26 PM
  3. Automate Numbering in form
    By Fauzi in forum Access
    Replies: 3
    Last Post: 02-09-2013, 01:08 PM
  4. Access 2003 aspect
    By Dominaz in forum Access
    Replies: 1
    Last Post: 01-25-2012, 09:52 PM
  5. Automate sending SMS form MS Access
    By Johan in forum Programming
    Replies: 8
    Last Post: 04-15-2010, 12:51 AM

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