Recent content by steevie_t

  1. S

    SQL Server Functions & Access ADPs

    Select it and return the one row, one column recordset... Sub GetDate() Dim rst As New ADODB.Recordset rst.Open "SELECT GetDate();", CurrentProject.Connection Debug.Print rst.Fields(0) End Sub or even worse... Sub GetDate() Debug.Print...
  2. S

    Query must have at least one destination field- running pass through query

    You say the first parameter is being highlighted when you debug... Perhaps setting the SQL string first would resolve this. I'd do Connection, SQL, ReturnsRecords then Parameters
  3. S

    Moving from MS-Access reports to SQL Server Reporting Services (SSRS)

    I'm comtemplating the move, because I think it will do the following: Centralise the reports Be easier to produce PDFs Produce HTML for when we want to report directly to the web Perform better Be easier to manage reports individually I could probably do all that with MS-Access but SSRS seems...
  4. S

    Batchfile for backup with timestamp

    There is an alternative that doesn't need vbscript or temp files... %DATE% and %TIME% are DOS environment variables and like other variables you can do simple string manipulation. i.e. SET CURHOUR=%TIME:~0,2% Gives the current hour, but watch out before 10 am this will yield a space so use...
  5. S

    "LastName, Firstname" trick

    Ah, the rec! is from my own code. I was working in a vba procedure and had declared rec as a recordset, and yes you are right Null + "Text" gives Null, Null & "Text" gives "Text"
  6. S

    "LastName, Firstname" trick

    Yes, very simple: ([Seniority] + " ") & [tbl_Emp_Discipline]![Discipline] & " " & [tbl_Emp_Position]![Position] Steve.
  7. S

    "LastName, Firstname" trick

    This is a useful trick: If you use a + to concatenate strings then it propogates nulls, if you use a & it doesn't... So in the expression: rec![LastName] & (", " + rec![FirstName]) If rec![FirstName] is Null then the expression (", " + rec![FirstName]) will be too, but the rec![LastName] &...
  8. S

    ADODB wildcard character range matching

    I've known for a while that ADODB uses the TSQL syntax when it comes to wildcards i.e. % to match multiple characters and _ to match a single character. Just found out that it still uses the DAO syntax when it comes to negative character ranges do you need to use the DAO ! rather than the TSQL...
  9. S

    My Dsum DontSum

    1) You can't access vairables within a string 2) There's a ] missing in the last line 3) Use a ! to reference a member of a collection not a . (that's for a method of a class) 4) If TotalDue is a field on the report then it is better to do this without using VBA. (search for "Calculate a total...
  10. S

    Stop macro using VBA

    Apart from using Sendkeys to send Ctrl+Break there isn't a command to explicitly stop a macro. You could put a condition in the macro that calls a VBA Function that returns a global variable that you can set while the macro is running... But you might as well just use VBA in the first place...
  11. S

    Table And Query disapearing?

    Sounds like a slightly corrupted file. Back it up, back it up again, and then do a Compact/Repair. You don't say how the database is shared, is it a Split database with Linked tables, or do all the users open the same file.
  12. S

    MS Access problem!. Please Help

    Linking the table is the right way to go. The easiest way to prevent updates in the linked tables is to go into Tools|Security|User and Group Permissions... select the table and clear the Update Insert and Delete Data check boxes. To keep the changes seperate create a seperate table in DB2 Link...
  13. S

    Is there a more elegant way of deleting records from VB than this? >>>

    Or just execute a little bit of SQL. CurrentProject.Connection.Execute "DELETE * FROM tblMyTable WHERE lngMyTableID = " & lngRecIDToDelete & ";" Me.Requery
  14. S

    Opening and closing the recordset, is there an easier way???

    Also take out the line: If rstG_AppFeePmt.Fields("fee_grp_typ_cod").Value = "003" Then and the related 'End If' and change rstG_AppFeePmt.Open "SELECT * FROM App_Fee_Pmt as a WHERE a.app_num LIKE '%" & dblAppNum & "%' ;", CurrentProject.Connection, adOpenStatic...
  15. S

    Opening and closing the recordset, is there an easier way???

    Another pointer that will make your code easier to read and maintain rstG_AppFeePmt.Fields("fee_grp_typ_cod").Value is equivalent to rstG_AppFeePmt!fee_grp_typ_cod (not much faster though)
Top Bottom