Search results

  1. S

    QueryDef.SQL vs. QueryDef.Parameters

    Example: SELECT [RecID],[StartDate],[EndDate],[LastName],[Sponsor],[Status],[Notes] FROM tblMain WHERE ([LastName] LIKE "Lee*" AND [StartDate] <= #5/1/2013# And [EndDate] >= #5/1/2010# _ And ([Status] = "Complete" OR [Status] = "Abandoned")) This is just one of an infinite number of possible...
  2. S

    QueryDef.SQL vs. QueryDef.Parameters

    Ok, so it looks to me like Parameters are beyond what I need. I think I just need the SQL property. Here's what I'm trying to do: I've got a form (frmEdit) that allows users to (1) search tblMain, (2) view those results in a subform, and (3) view the current record in a set of bound controls...
  3. S

    QueryDef.SQL vs. QueryDef.Parameters

    Noob question, probably, but some cursory searches failed to deliver what I'm sure is a pretty simple answer. QueryDef objects (http://msdn.microsoft.com/en-us/library/office/bb177500(v=office.12).aspx) have a couple properties I'm having a hard time understanding the difference between: Use...
  4. S

    Counter textbox on form not updating

    Yup. I know it's fine because it shows the proper totals after I change the current record. It just doesn't display immediately (as soon as the form is opened), even if I employ some kind of delay.
  5. S

    Counter textbox on form not updating

    Thanks, eugin, I'll see about giving that a try. My goal was originally to make the form behave somewhat like a split form (but actually using a split form placed too many restrictions on me). So I'm settling for a compromise where users can navigate through a subform using the default...
  6. S

    Counter textbox on form not updating

    Update: So I can get txtCounterDisplay to update properly (accurately and immediately) if I simply use: Private Sub CountRecords() Me.Recordset.MoveLast Me.Recordset.MoveFirst Me.txtCounterDisplay.Value = Me.CurrentRecord & "/" & Me.Recordset.RecordCount End Sub Bot WOW do I...
  7. S

    Split Form Behaviours with Subform

    An update: I was able to prevent the error on load by adding a one second delay to the subMain Form_Current module. But that seems to have stopped working after I added code for a counter to my frmEdit module. http://www.access-programmers.co.uk/forums/showthread.php?t=246452 Very perplexing...
  8. S

    Counter textbox on form not updating

    I have a form (frmEdit) On that form is a subform (subMain) On that subform is a footer, and in that footer is a textbox (txtCounter) whose control source is: =Count(*) On frmEdit I have placed a textbox (txtCounterDisplay). I have created a subroutine (Private Sub CountRecords()) to control...
  9. S

    Split Form Behaviours with Subform

    That's the one! Thanks! Sorry for the delay. I think I've managed to make BuildFilter work properly again using your debugging techniques. strWhere wasn't being constructed properly and was feeding nonsense to .FindFirst through BuildFilter. I'm still encountering issues with the...
  10. S

    Split Form Behaviours with Subform

    Oh, that'd be fantastic. Thanks so much :) EDIT: removed lengthy code addition. Included in code tags in post below.
  11. S

    Split Form Behaviours with Subform

    I was not aware. Thanks for the info. Working on putting it back together. Should have saved it in a separate file :P
  12. S

    Split Form Behaviours with Subform

    Wait... I swear I replied to this, posting my code and whatnot. Was it removed? I spent a lot of time redacting everything, etc...
  13. S

    Split Form Behaviours with Subform

    Based on the behaviours I'm getting from this code and the debugging process, it's pretty clear to me that the problem is in the Buildfilter function itself. What confuses me is that an almost identical version of this code exists on another form, and it functions perfectly over there. So I...
  14. S

    Split Form Behaviours with Subform

    Bob, thanks so much for getting back to me. I really really appreciate it. I've taken your advice and changed the variants in buildfilter to strings. My code (modified from your original) now looks like: Private Sub Form_Current() Dim rst As DAO.Recordset Set rst =...
  15. S

    Split Form Behaviours with Subform

    Ok yeah so I can't get the Immediate window to display the value of BuildFilter2, even when I'm actually able to step into each line of code and "properly" debug. But hovering over it tells me BuildFilter2 = "". So that's a start. I assume that "" is an invalid criteria for .FindFirst. Aside...
  16. S

    Split Form Behaviours with Subform

    Ok, I'll play around with that (though hovering over BuildFilter2 informed me it was ""). I'm new to VBA, and thus also to debugging, so please forgive my next question: The run button makes me create a macro? I don't understand. I just want to step through the code in my existing module, no...
  17. S

    Split Form Behaviours with Subform

    Ok, so I initialized varWhere as "" instead of as Null. That makes sense, right? That led to another error, though: Run-time error '3077': Syntax error (missing operator) in expression Clicking Debug highlights rst.FindFirst BuildFilter2
  18. S

    Split Form Behaviours with Subform

    Thanks. Now I'm getting a new error, though: Run-time error '94': Invalid use of Null Clicking Debug highlights the line you advised me to change.
  19. S

    Can'd add DAO reference. Even to brand new db.

    Oh definitely. I already tried to get some help on this without any luck, but the original post is here if you're interested: http://www.access-programmers.co.uk/forums/showthread.php?t=245654
  20. S

    Can'd add DAO reference. Even to brand new db.

    pbaldy nailed it. Did not know it included DAO. Okay, so that should help me narrow down where the problems are coming from in my existing code. I can rule out DAO not being an active reference. Thanks :)
Back
Top Bottom