Recent content by SimonB1978

  1. S

    Martin-Luther-King. Just lipservice or progression?

    I visited Boston this summer. Not THAT expensive beside hotel rooms. I think the main reason is that lots of hotels were "No Vacancy". Likely a demand/offer thing. What I suggest is getting an hotel a bit outside of town but close to a subway line (what we did). We then got a 7-day unlimited...
  2. S

    General function to write a log record

    Your variables name don't match. See in RED. You should add Option Explicit at the beginning of your code, it would catch those things.
  3. S

    General function to write a log record

    2 things: - remove the ' after VALUES( - you declared lntLogNumber but you use intlognumber in your function
  4. S

    Help with Determing if Date is a Holiday

    You could use a DLookup with the selected date in the criteria. If it returns Null, the date was not found in the table. HTH, Simon B.
  5. S

    General function to write a log record

    You could use something like this in a code module: Public Sub AddLog(lngLogNumber, strlocation, stremployee, strlogtext) Dim strSQL As String strSQL = "INSERT INTO tblLog(LogNumber, Location, Employee, LogText) " & _ "VALUES('" & intlognumber & ",'" & strlocation...
  6. S

    splitting data in one field to two fields

    Hi, This should work: SELECT Left(name_field, (Iif(InStr(1, name_field, ',') > 0, InStr(1, name_field, ',')-1, 0))) as last_name, Mid(name_field, InStr(1,name_field, ',') + 1) as first_name from table_name BTW, the Iif is there to take care of the case where there would be no comma in the...
  7. S

    ENtering data in a new column UniqueID in a table

    Hi, This should give you an idea.... Sub AddID() Dim rst As DAO.Recordset Dim lngID As Long Set rst = CurrentDb.OpenRecordset("Table1") lngID = 1 While Not rst.EOF rst.Edit rst.Fields("ID") = CStr(lngID) rst.Update...
  8. S

    Automating Mailmerge problem

    Here is how I do it: Dim objWordApp as Word.Application .... Set objWordApp = CreateObject("Word.Application") Set objWord = objWordApp.Documents.Open(stDocName) ... That way nothing is prompted and the mailmerge is done
  9. S

    Math formula

    There you go: http://mathcentral.uregina.ca/QQ/database/QQ.09.04/bob1.html I thought it would be more complicated than that... Simon B.
  10. S

    Adding leading zeros to alphanumeric text

    Hi, Format(your_number, "00") should do it.
  11. S

    Reference to template added to VBA Project

    Hi, We just added a macro to one of our Word documents. We have a problem with 1 user. When that user opens the document, a VBA reference is added to a template that resides on his personal network space. When another user then opens that document an error is raised since that person cannot...
  12. S

    American English

    Honestly, English as a second language is really not that hard, if you put aside the freaking "th". That thing is unpronounceable. Way fewer grammar rules than French (my first language). If you think there is a big difference between American and British English, you should see (or actually...
  13. S

    Sql syntax error? and running sum? help?

    Hi, In the DSum statement, you're missing a parameter for the table name (between the field name and criteria). Simon B.
  14. S

    If Or And statement possible...?

    Probably need some parentheses (bold red): If (Me.Ctl2nd_Payment_Payable = "Paid" Or Me.Ctl2nd_Payment_Payable = "Pagado") And IsNull(Me.Ctl2nd_Payment_Date_Paid) Then MsgBox ("Error - Check the 2nd Payment details as it says PAID / PAGADO yet the date paid has not been added")...
  15. S

    Deletes Tables in Backend imports into Front End

    Perhaps you could import in your FE in a temp table and use DoCmd.CopyObject to copy the table into the BE. Not the best but it should work....
Top Bottom