Results 1 to 2 of 2
  1. #1
    Meanfish is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    3

    DMAX in VBA

    DMAX in VBA, trying to get a 1 up to work.

    Hey Guys and Gals,

    Hoping someone can help me out with this. Scenario is, on new customer form (Customer Table Query) (yes thats the name of the form, I know bad conduct lol) If the Field (Customer Type) = "EMERGENCY RELIEF" then the "Membership Number" field, = Highest number in 'Membership Number' field in the Query (Customer Table Query)(yeah, i know really bad nameing, but kinda too late now). +1

    Here is my attempts so far,

    Private Sub CustomerType_AfterUpdate()
    If [CustomerType] = "EMERGENCY RELIEF" Then
    Membership Number = DMax("Membership Number", "Query!Customer Table Query") + 1
    End If


    End Sub

    Any help would be greatly appreciated, Thankyou

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Use the Me. prefix when referencing your form objects and the intellisense will give you a list of valid values from which to select.

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

Similar Threads

  1. Replies: 6
    Last Post: 07-24-2012, 03:02 PM
  2. How to use DMAX
    By tomneedshelp in forum Access
    Replies: 2
    Last Post: 03-01-2012, 07:22 AM
  3. Using Nz and Dmax
    By timmy in forum Programming
    Replies: 5
    Last Post: 07-04-2011, 06:42 AM
  4. DMAX syntax
    By tuyo in forum Programming
    Replies: 1
    Last Post: 03-24-2011, 12:15 AM
  5. DMax Condition
    By Luis Ferreira in forum Forms
    Replies: 3
    Last Post: 11-05-2010, 09:48 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