Search results

  1. nschroeder

    Autonumber loop? (subnumber)

    You should probably normalize your tables. No reason to have all the fields in both. The Sample table should have SampleID as primary key, and dates and other fields unique to each sample. The Prism table linked to it, with SampleID plus prism # as pk, with only data unique to each prism. Then...
  2. nschroeder

    Help me vba search

    I tested the code before I posted, and it works. What error did you get?
  3. nschroeder

    Help me vba search

    I think you can solve your issue by changing the format property of txtDateFrom to "Short Date" (and probably renaming it to dtDateFrom). Then your code could be: If Me.dtDateFrom > 0 Then varWhere = varWhere & "([DOB] >= " & Me.dtDateFrom & ") AND " End If
  4. nschroeder

    stop blank fields being logged

    Back from the weekend. Sorry about the coding errors. My cutting and pasting failed me. Thanks for the assist Solo712.
  5. nschroeder

    stop blank fields being logged

    You also may need to consider the possibility of them blanking out an existing value. If that's a change you want to log, then change the above to: If varNew = "" and varNew = varOld then Exit Sub
  6. nschroeder

    stop blank fields being logged

    I would adjust it like this: varOld = Screen.ActiveControl.OldValue varNew = Screen.ActiveControl.Value If IsNull(varNew) "" then Exit Sub If varNew = "" then Exit Sub strFormName = Screen.ActiveForm.Name I'm not sure if you need both If statements. You can play around with...
  7. nschroeder

    How to use InStr to find a fields value in text

    I meant have the code plug it in. Not you typing it in.
  8. nschroeder

    How to use InStr to find a fields value in text

    Well, in those cases, you already know the JID, so just plug it in the form. I'm sure you can handle it. I'd hate to have all the fun!
  9. nschroeder

    How to use InStr to find a fields value in text

    I see. To do that would require returning multiple values from the function, which can be done, but probably more cumbersome than needed. Instead, I converted the function to a subroutine and made some other adjustments. Here's the full code: Option Compare Database Dim db As Database Dim...
  10. nschroeder

    How to use InStr to find a fields value in text

    That's what I was addressing in the second code window above. Unless I'm not understanding your question.
  11. nschroeder

    How to use InStr to find a fields value in text

    Assuming that either the JID or the Conf No (but not both) will appear in either the subject or the body, this will check both subject & body at the same time: strTxtVal = Me.Subject & " " & Me.Body strTxtVal = Replace(strTxtVal, ".", "") ' Repeat for other characters as needed...
  12. nschroeder

    How to use InStr to find a fields value in text

    Stewart, I just wanted to make sure you got my "never mind" update above. You could use the Replace function to remove unwanted characters before you start. strTxtVal = Replace(Me.Body, ".", "") ' Repeat for other characters as needed aInput = Split(strTxtVal, " ") -Nate
  13. nschroeder

    How to use InStr to find a fields value in text

    Never mind what I just said above. I see what the problem is. In record 2, strWord apparently picked up the crlf and included it prior to the "JID0002" so the left(strWord,3) code just returned a "J". In record 4, the conf number includes a period, so it didn't find a match. If you adjust the...
  14. nschroeder

    How to use InStr to find a fields value in text

    The code currently looks at the "body" only, and the body on your form doesn't currently contain either a Job ID or Conf Number. You can test it by pasting one in. It that the problem?
  15. nschroeder

    How to use InStr to find a fields value in text

    This seemed to work with the testing I did. I also took some liberties with your code and simplified some things, e.g., instead of handling each line in the message separately, it now handles the whole thing word-by-word. If you need it otherwise, I'm sure you can take care of it. Also, it...
  16. nschroeder

    How to use InStr to find a fields value in text

    No problem Stewart. I usually need things explained at least twice before I begin to comprehend. So with that in mind, please explain how you know which JID goes with which conf no. It doesn't appear, from your db, that they are both in the same email message. You said the conf no is already in...
  17. nschroeder

    How to use InStr to find a fields value in text

    You said the two fields will appear in the email. Then you said the SupplierConfirmationNo will never appear in the email. So which is it?
  18. nschroeder

    Converting an Excel VBA macro into an Access module?

    I haven't looked extensively at your code to determine what you are trying to accomplish, but there seem to be things that could be done more efficiently. For example, eliminate the four_digit_conv function and replace the line that calls it: ActiveSheet.Cells(counter, intDES).Value =...
  19. nschroeder

    Yes/No message box macro help

    I'm wondering why you need a Save button. Unlike Excel or Word, Access saves the changes to your data automatically as soon as you leave the current record or close the form, so a Save button would serve no such purpose. If you've started editing a record and then change your mind, just hit...
  20. nschroeder

    Questionnaire result (Record to row)

    That does work. Thanks. But squawking about "Do Until" vs. "Do While"? Seriously?
Back
Top Bottom