Search results

  1. J

    Send SMS from VBA

    @Spikepl Did you resolve the problem with special characters like ÆØÅ and others? if not then this function might help. I use it myself to encode SMS messages before I send it to my provider. Public Function URLEncode(StringVal As String, Optional SpaceAsPlus As Boolean = False) As String...
  2. J

    Rubtime error 2501

    I said After the line. ' Open a report. Case conCmdOpenReport DoCmd.OpenReport rs![Argument], acPreview If Err.Number = 2501 Then Err.Clear JR
  3. J

    Rubtime error 2501

    Just trap error 2501. Put this in the next line of where the debugger stopped: If Err.Number = 2501 Then Err.Clear JR
  4. J

    .RecordCount problem

    If the goal is just to count a recordset then yes it would be ponitless to create a DAO.Recordset just to do a count, you might as well use Dcount() which I suspect opens a recordset in some fashion and returns the count. But if you want to do something with the recordset when it is fully...
  5. J

    Trim first and last characters

    The Mid() function is: Mid(String, Start, Length) Not: Mid(String, Start, Stop) From Acces help: So if x= "USDA: 10a" -> 9 characters then: Trim(Mid(x,6,Len(x)-6)) -> Lenght = Len(x) -> 9 - 6 -> 3 characters lenght and trim the space at the end. Hope this helps JR
  6. J

    .RecordCount problem

    It uses Rushmore optimisation by coersing jet to use the primarykey index to search the table, a fun discussion at UtterAccess here: http://www.utteraccess.com/forum/lofiversion/index.php/t1942623.html JR
  7. J

    .RecordCount problem

    There is one way to get the recordcount without using .MoveLast, if you have a numeric recordID you can do something like this to force to open all records. Function CountRec() With CurrentDb.OpenRecordset("select * from MyTable where [ID] > 0 or [ID] < 0") Debug.Print .RecordCount End...
  8. J

    VBA Code to Loop Through Macro Modules

    Not that I am aware of, the only way I ca think of is to export the macros to a text file and edit the textfile and import the macros back. Application.SaveAsText and to load the modified macro back using Application.LoadFromText Here is a code to export all macros to current folder where...
  9. J

    Reverse phone lookup

    You can use: Application.FollowHyperlink URL-string Here is the one I use as a function in a Standard Module Public Function sYellowpages(phone As Long) Const sStr = "http://www.gulesider.no/gs/categoryList.c?q=" 'URL-sting to Yellowpages Application.FollowHyperlink sStr & phone End...
  10. J

    Splitting Text

    Definitivly NOT! The individual choices are not fields (Columns) in a table but individual records (Rows) in a table. Access is not Excel where this schema would be more "correct". I assume that you use Access 2010 since you are using sharepoint and that the records in your linked Sharepoint...
  11. J

    Changing combo list based on button press

    If you want the code under MinutesCheck_Click() sub to run after you click on the button you also need to explicitly call it or els it would not run. Private Sub NegativeMinutes_btn_Click() Me.MinutesCheck = Not Me.MinutesCheck Call MinutesCheck_Click End Sub However I think using the...
  12. J

    Alert or Warning message

    If you have a query that selects the planes with maintenance issues then you can use DCount() function against this query. If the count comes back > 0 then a record is found and warn your users. ex: Private Sub AC_ID_AfterUpdate() If DCount("*", "qryTotalAirTime", "AC_ID =" & Me.AC_ID) > 0...
  13. J

    Is Null question

    http://allenbrowne.com/QueryPerfIssue.html JR
  14. J

    VBA code to add 30 days in PrintDate and display Label caption

    You could at least TRY and do it yourself, to get you started see if this query gives you the correct records: Select ProjectRef From MyTable Where DateDiff('d', [VPrintDate] ,Date()) >= 30; Match whats marked in red with your own setup. JR
  15. J

    VBA code to add 30 days in PrintDate and display Label caption

    You could create a query that selects the ProjectRef and filters out the dates that are due using the DateDiff() function, then you can open a recordset based on this query and loop through it and grab the ProjectRef's and build a StringVariable that you assign to your lable. JR
  16. J

    DCount problem

    You have two choices, either format the date outside the string to an uambigious dateformat or use the full form refrence to your datecontrol inside the expression. Either: CheckDate = DCount("*", "tblDATEOpen", "[ACTUALDATE] =" & Format(Me.IBTDATE ,"\#mm\/dd\/yyyy\#")) Or: CheckDate =...
  17. J

    How to replace certain characters in the whole table at once?

    An alternative is to use the Replace() function if you run Access 2000 and newer. Function FixTable() Dim fld As DAO.Field Dim db As DAO.Database Dim strSQL As String Dim tbl As String Set db = CurrentDb() tbl = "Mytable" For Each fld In db.TableDefs("[" & tbl & "]").Fields If fld.Type =...
  18. J

    Print conditionally

    You have Dim'ed the variable Currencys BUT you have NOT set it to anything so it will always be an empty string and your IF statement will only execute the Else-part and open the report "USDCheques". Private Sub PrintCheque_Click() On Error GoTo Err_cmdPrintLabel_Click Dim Cheque As...
  19. J

    Using vba variables in forms commands

    Function TESTFUN(FN, TB As String) DoCmd.OPENFORM (FN), , , , , acDialog Forms(FN).Text(TB).SetFocus End Function acDialog mode halts further code execution until the form has closed so it won't get to the next line of code so when you close the form and the code advances you will get an error...
  20. J

    Help with update record using runsql

    Yeah I usually talk directly to the DBEngine as this is faster and you don't have to deal with all those update warnings. :) but for a novice who struggle with delimiters and dates that is not US dates it is a good solution to let the Application handle those issues. JR
Back
Top Bottom