Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Dal Jeanis is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    I'm working on it. I'm finding macros very mysterious. With VBA I always know where the activity is coming from.



    Okay, my first act would be to update the macro for cboFilterFormExpenseType : AfterUpdate .

    Delete the action Searchfor, and add two actions: ApplyFilter and then Requery.

    The filter should be something like
    Code:
    "[Expense Type] = " & [Forms]![Expenses]![cboFilterFormExpenseType]
    or possibly
    Code:
    "[Expense Type] = [Forms]![Expenses]![cboFilterFormExpenseType]"

  2. #17
    maxmaggot is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ireland
    Posts
    91
    Thanks Mike.

    Its 4 a.m. here so I'm gonna hit the hay. I'll update you tomorrow on progress. Thanks so much for the help. It really is appreciated

  3. #18
    Dal Jeanis is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    K. I deleted the embedded macro behind the AfterUpdate, then activated some VBA that does the same thing. Appears to work.
    Code:
    Private Sub cboFilterFormExpenseType_AfterUpdate()
        Me.Filter = "[Expense Type] = " & Me.cboFilterFormExpenseType.Column(0)
        Me.FilterOn = True
        Me.Requery
    End Sub
    And here's the code to turn off the filters.
    Code:
    Private Sub cmdShowAllExpenses_Click()
        Call SwitchFilterOff
        Me.cboFilterFormExpenseType.SetFocus
        Me.cboFilterFormExpenseType = Null
    End Sub
    
    Private Sub SwitchFilterOff()
        Me.FilterOn = False
        Me.Filter = ""
    End Sub
    Now, one thing I noticed is that you're calling a few routines "functions" that don't return values. It ain't a function if it ain't returning a value.

    Don't try to fix it now, since it's working, but all of those should be subs instead, and they should be invoked with "Call Subname" rather than just "FunctionName".

    Sweet dreams, and let me know if you need anything else. I'll be on holiday tomorrow, but I'll try to check back in the morning (my time) anyway.

    By the way, my name's Dal.

  4. #19
    maxmaggot is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ireland
    Posts
    91
    Thanks again. Where did I get Mike?????? Sleep deprivation.

  5. #20
    maxmaggot is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ireland
    Posts
    91
    Thanks so much Dal,
    Everything worked out great. It won't let me add anymore to your reputation until I spread the wealth but I will do ASAP.

    Really appreciate the help you have given me.

  6. #21
    Dal Jeanis is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Congratulations, you made your deadline!

    Yeah, by 4 AM I don't know what will come out of my fingers. No offense taken.

    I'm deleting the db off my machine. For any new questions, please start a new thread.

  7. #22
    maxmaggot is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Location
    Ireland
    Posts
    91
    Thanks Dal. Life saver

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 11-12-2012, 03:52 AM
  2. Combo to find record on report
    By djclntn in forum Reports
    Replies: 2
    Last Post: 04-03-2012, 02:54 PM
  3. VBA: Find Record from in table from form
    By shimmy84 in forum Programming
    Replies: 6
    Last Post: 03-19-2012, 10:51 PM
  4. best way to find a record in a linked table
    By BRV in forum Programming
    Replies: 14
    Last Post: 11-10-2011, 09:31 AM
  5. Replies: 5
    Last Post: 11-13-2010, 04:56 PM

Tags for this Thread

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