Search results

  1. VilaRestal

    Sending Emails without Outlook.

    Hmm that might be something your mail server imposes on it. You could try adding either or both of these lines within the With cdomsg block .Sender = sFrom .ReplyTo = sFrom ReplyTo should automatically be the same as From and your mail server might not allow Sender to...
  2. VilaRestal

    Screen Flashes, Flickers and Form Refreshes

    No, I gave up trying to beat this long ago. I just try to avoid labels unassigned to controls and overlapping controls when I remember to and can. But still, even without those, Access seems to refresh forms (in the true sense rather than the refreshing the data) in response to certain events...
  3. VilaRestal

    Setting focus on a field in a subform from a main form

    Check out StrConv(s, vbProperCase), will make all words first letter upper-case, other letters lower-case. You could either process the input in place or just format it for display. It has it's limitations when applied to full sentences (acronyms and hyphens and things aren't handled quite...
  4. VilaRestal

    ProperCase with Hyphens/Brackets in between

    You're welcome. It's a whole new world. Enjoy exploring it ;)
  5. VilaRestal

    ProperCase with Hyphens/Brackets in between

    It's the parameter declared as Private Function AllCaseEachOfWord(..., Optional ByVal blnUpper As Boolean = True)... As false it means it will make the words lower-case (not Upper) As true (or omitted, it defaults to true) it will make the words upper-case. because of the repeated code...
  6. VilaRestal

    ProperCase with Hyphens/Brackets in between

    Also, I don't like the idea of editing the data in the table while your developing and testing it. Only tie it to the table in that way when you're sure it's working how you want it. The test sub I initially had in place is the kind of thing you should be using. Only when you've tried a range of...
  7. VilaRestal

    ProperCase with Hyphens/Brackets in between

    First time I posted the code above I forgot to assign the return value of AllCaseEachOfWord = strIn Check you version has that line in at theend of AllCaseEachOfWord sub (perhaps you copied it before I'd done the edit - sorry if you have) the code as it is now works for me.
  8. VilaRestal

    Setting focus on a field in a subform from a main form

    Or an improved version that will work no matter what the controls are called and for any number of sbforms: Private Sub Form_Current() SetFocusFirstControls Me.Form End Sub in the parent form's module and Public Sub SetFocusFirstControls(ByRef frm As Form) On Error Resume Next Dim...
  9. VilaRestal

    ProperCase with Hyphens/Brackets in between

    Oh and btw, you can edit previous posts, you don't have to repost the code to put it in code brackets. It would be good if you could edit the first so the code in it is in code brackets and edit the other two so they just say "deleted duplicate" or something like that.
  10. VilaRestal

    Setting focus on a field in a subform from a main form

    Ah I see, as datasheets or continuous forms the control with the focus is remembered in the subform. I think one way to fix it would be in the parent form's current event put code that sets the focus to the subform's first control and then sets the focus to the parent form's first control. So...
  11. VilaRestal

    ProperCase with Hyphens/Brackets in between

    Sadly not. Version 2 with the fix mentioned would be: Public Function SuperStrConv(ByVal s As String) As String 'Works the same as StrConv(s, vbProperCase) except capitalises text between two hyphens without spaces either side of hyphens and capitalizes first letter after an open bracket...
  12. VilaRestal

    ProperCase with Hyphens/Brackets in between

    I've discovered a problem with the version shown. The test Private Sub TestSuperStrConv() Debug.Print SuperStrConv("REPLACE 1400-P-411 GATE VALVE, REPLACE 2123-LV-007 BYPASS SPOOL VALVES (TRAIN 3), REPLACE 8300-FG-811 CHECK VALVE") End Sub shows it. The fix is to replace...
  13. VilaRestal

    QueryDef

    You're welcome. If I may add the lboHosCat_AfterUpdate sub could even be rewritten as this: Private Sub lboHosCat_AfterUpdate() Dim qdf As QueryDef Set qdf = CurrentDb.QueryDefs(IIf(Me!lboHosCat.Selected(Me!lboHosCat.ListIndex),"qryAppCatID","qryRemCatID"))...
  14. VilaRestal

    ProperCase with Hyphens/Brackets in between

    To add the extra feature do it in sequence. Don't try to mix the two processes together and it's not either or, we want to process it for both hyphens and open brackets. First we apply the StrConv, then to the result of that we process to capitalize the letters between hyphens, then to the...
  15. VilaRestal

    ProperCase with Hyphens/Brackets in between

    OK cool I'm glad it's along the right lines. Thanks JANR for explaining. Sorry I wasn't around to myself.
  16. VilaRestal

    ProperCase with Hyphens/Brackets in between

    How about this: Public Function SuperStrConv(ByVal s As String) As String 'Works the same as StrConv(s, vbProperCase) except capitalises text between two hyphens without spaces either side of hyphens 'Process as StrConv(s, vbProperCase): s = StrConv(s, vbProperCase) 'Check for...
  17. VilaRestal

    Setting focus on a field in a subform from a main form

    I can't replicate the behaviour you describe. Moving to a new record in the parent then tabbing into the subform always goes into the first control of the subform no matter what control last had the focus in the subform before. Perhaps there's something about your configuration that could cause...
  18. VilaRestal

    QueryDef

    I would say the declaring of the query defs at the module level and assigning them on Form Open is unnecessary and not great practice. Could I suggest this: Option Compare Database Option Explicit Private Sub Form_Open(Cancel As Integer) CurrentDb.Execute "Delete * FROM...
  19. VilaRestal

    QueryDef

    Change the query to INSERT INTO tblMultiSelectReportCat (CatID) VALUES ([currCatID]) should do it for qryAppCatID DELETE FROM tblMultiSelectReportCat WHERE CatID = [currCatID] should do it for qryRemCatID (I guess) I think the code's OK except...
  20. VilaRestal

    Me returning different results to Forms("MyName")

    Questions that spring to mind: Do If Me.Parent.ChildForm.Form.ChildForm.SourceObject="fsubFormatTracks" Then and Me.Parent.ChildForm.Form.ChildForm.SourceObject="fsubTitleFormats" work? Is there On Error Resume Next in the code (before)? Have you tried switching off and seeing what error it...
Top Bottom