Search results

  1. J

    Access Sql Code syntax

    Somthing like this: strSQL = " UPDATE [patient]" & _ " SET [Current_Med] = '" & MyMed & "'," & _ " [SType1_Desc] = '" & Me.SType_1 & "'," & _ " [SType2_Desc] = '" & Me.SType2 & "'," & _ " [SType3_Desc] = '" & Me.Stype3 & "'" & _ " WHERE ([UID] = '"...
  2. J

    Text search in access database-find the exactly matched word(s)

    The error is just what it said, some of your records holds a NULL value in the field you want to search and using functions like Right() on a null field without using Nz() function as a wrapper will cause an error. Since there is no point searching a null anyway, a null is a null, create a...
  3. J

    Text search in access database-find the exactly matched word(s)

    Updated version in post #7 here: http://www.access-programmers.co.uk/forums/showpost.php?p=1195141&postcount=7 Also added the possibility that the RecordID which is passed to the function could be a string, see the optional parameter for the two functions. JR
  4. J

    Text search in access database-find the exactly matched word(s)

    Nothing stange at all considering that the test for a matching record in the code is this: If IntAnd = UBound(SearchItem) + 1 Then In you search for "applepie and mushroom" IntAnd should equal to 3 for a match, but in actuallity it is 4. Look at the string and you see it will find the word...
  5. J

    Text search in access database-find the exactly matched word(s)

    The new/edited record has to be saved to the table BEFORE you can search for it. Thats an easy fix, you add this code in the cmdSearch_Click() event before you call the MySearch() function. If Me.Dirty Then Me.Dirty = False Also the Run-time error was caused by an Error in the code which was...
  6. J

    Text search in access database-find the exactly matched word(s)

    I understand that you have a problem with the code I gave you. You get an Run-time error and the code stops at .MoveNext, but I have that all over the procedure so it is impossible do debug it from where I am, if you want you could post a samplebase with confidential data removed so I can take...
  7. J

    The code I posted to you, I hope you understand how it works, if not PM me and I can give you a...

    The code I posted to you, I hope you understand how it works, if not PM me and I can give you a more detailed walkthrough JR
  8. J

    Text search in access database-find the exactly matched word(s)

    Don't know really you have to test it, on todays PC's it should only be milliseconds. But a millisecond here and there would add up eventually. JR
  9. J

    Text search in access database-find the exactly matched word(s)

    Sure its possible but remember that this sort of looping will become slower and slower when the searchstring gets longer and the amount of records to be searched is growing. See attached db. If you don't want to download the db you can copy the code into a Standard module and just call it...
  10. J

    Text search in access database-find the exactly matched word(s)

    I don't think you can do what you want in a query, you'll need to use some VBA and open a recordset on your table and compare the word you are searching for step by step. If you split your tablefield into an array and compare each array element to your searchword using StrComp() function you...
  11. J

    Is there a similar decompile process for Excel 2007 files?

    Just to check, have your tried this: http://http://www.access-programmers.co.uk/forums/showthread.php?t=213807&highlight=phantom+breakpoint JR
  12. J

    Date not saved correctly!

    Access use US date formats mm/dd/yyyy so yor format() function is incorrect. DoCmd.RunSQL ("Update tblTmpSupplierOrderAllDetails set PurchaseOrderDate = #" & Format(Me.dteInvoiceDate, "mm/dd/yyyy") & "#") How ever since you have formatted your control dteInvoiceDate as a Date and you are using...
  13. J

    3134 Error - Code works for other forms??

    strSql = "INSERT INTO [tblFluidSum] ( GenSumFK, MudType, [Mud Wgt], PV, YP, [LGS%], [SG Solids], [SG Base Fluid], [Vol% Solids], [Vol% Oil], [Vol% Water], [Salt CaCl], [Mud Temp], [Oil/Water Ratio], [Brine Wgt], BrineType, [Salt Content] ) " & _ "SELECT " & lngID & " As...
  14. J

    InStr function to split column

    No problem JR
  15. J

    InStr function to split column

    Use Mid() function instead, easier COMPANY: IIf([SCOMPANY] Like "*-*", Mid([SCOMPANY],1, Instr([SCOMPANY],"-")-2), [SCOMPANY]) The correct syntax for Left() would be: COMPANY: IIf([SCOMPANY] Like "*-*",Left([scompany],Len([scompany])-InStr(1,[SCOMPANY],"-")+1),[SCOMPANY]) JR
  16. J

    Make a control visible when record is loaded

    The error msg give you the answer, the .Text property is only available when the control has focus which it does not in the AfterUpdate event, use the Default .Value property instead. Private Sub Caixa_de_combinação28_AfterUpdate() If Me.[Caixa de combinação28].Value= "Execução" Then Me.[Caixa...
  17. J

    How to create a string from a query

    No problem, happy to help JR
  18. J

    How to create a string from a query

    You can try and use Null propagation when concationate your string. Assuming that [Field1] ALWAYS have data: Expr1: ([Field1]) & ("/" + [Field2]) & .... & ("/" + [Field52]) Note the "+" inside the perens, if the field is null the whole expression inside the perens is null and is omitted from...
  19. J

    Forced.... Runtime Code Break

    Sounds like a phantom breakpoint have crept in you code, check out this http://www.access-programmers.co.uk/forums/showthread.php?t=169646&highlight=phantom+breakpoint and see if that helps JR
  20. J

    If IsNull checking two text boxes on two different sub-forms

    To refrence a control on a subform add .Form Private Sub Form_Load() On Error Resume Next ' We have to go through with this come what may! Dim Answer As Integer If IsNull(Forms![frmprojectmaster]!sfrData.Form!txtStartDate) And...
Back
Top Bottom