Search results

  1. nanscombe

    Question dates and uniques

    Just trying Int(dateTimeField) and Datevalue(dateTimeField). VBA: print int(#3/1/2014 10:00#) 01/03/2014 ' Expected 03/01/2014 print datevalue(#3/1/2014 10:00#) 01/03/2014 ' Expected 03/01/2014 Hmmm, it appears to transpose DD/MM (UK format) to MM/DD (American format) and doesn't work as...
  2. nanscombe

    Question dates and uniques

    Currently trying the events as follows, I have attached the demo database I was using. Private Sub check_in_AfterUpdate() Debug.Print checkForExistingBooking(Me.roomno, Me.check_in, Me.check_out, Me.ID) End Sub Private Sub check_out_AfterUpdate() Debug.Print checkForExistingBooking(Me.roomno...
  3. nanscombe

    Question dates and uniques

    Mainly because Dates are actually stored as DateTimes and I prefer to avoid any ambiguity. Progress so far .. Public Function checkForExistingBooking(ByVal cebRoomNo As Variant, ByVal cebCheckInDate As Variant, ByVal cebCheckOutDate As Variant, ByVal cebID As Long) Dim varTemp As Variant...
  4. nanscombe

    Question dates and uniques

    Since someone could check in on the same date as someone checks out the check in date must not be >= the check in date AND < the check out date of any other record. What must be done is to count any records where this is the case and flag a warning if any exist. *** Work in Progress ***...
  5. nanscombe

    Bartender Vs Tony Blair

    At first I thought it would be comparing one bar steward with another. :D However, it's more likely to be about The February dossier aka the "dodgy" dossier. Part of Tony Blair's entourage appear to have altered the meaning of, or exaggerated, intelligence reports to improve his case for going...
  6. nanscombe

    Append to a TXT document using variable file name-problem

    I have just tried to recreate the problem above, including creating the user "john employee" and using the code below, but was unable to recreate the problem. :( Private Sub Form_Current() Me.MPathSSABlank = "c:\users\john employee\documents\access\ssatsi2013.txt" Me.MPathSSANew =...
  7. nanscombe

    Input from form into code.

    An improvement to the code ... Private Function getFileCount(byVal gfcPath as String, byVal gfcWildcard as String) Dim file As Object Dim fileCount As Long fileCount = 0 With CreateObject("Scripting.FileSystemObject").getfolder(gfcPath) If gfcWildcard = "*.*" Then ' If wildcard is...
  8. nanscombe

    Input from form into code.

    Since the paths are similar too you could do this. Dim fileRoot as String, weekNo as Long, theYear as Long fileRoot = "\\testmachine\Product1\" theYear = Format(now(), "YYYY") ' Prompt for a weekNo weekNo = nz(InputBox("Enter a week no between 1 and 52"), 0) ' Traps the Week No...
  9. nanscombe

    Input from form into code.

    If you've got blocks of code that repeat, as in your code above, it could be turned into a Sub (if it doesn't return a value) or a Function (if it does return values) in its own right. As you want to return a count I would create a Function. The main difference to each block of code is the...
  10. nanscombe

    Append to a TXT document using variable file name-problem

    Do you mean ... If FileExists(strFile) = False Then FileCopy strFileBlank, strFileNew End If as you haven't defined strFile, or If FileExists(strFileNew) = False Then FileCopy strFileBlank, strFileNew End If
  11. nanscombe

    Still having Null issues

    I've attached a demo of what I think you are trying to achieve. Is this the sort of thing you are after? Private Sub flagSim() Dim blFlag As Boolean Dim Days As Integer, Days1 As Integer ' Set flag to False blFlag = False ' Default date of 12/12/2099 for null value Days =...
  12. nanscombe

    Possibly a dumb question

    Access: File association errors opening databases by double clicking
  13. nanscombe

    need help calculation Date / Time

    Since we don't know exactly what you are using it for... Function differenceInHHMM() takes two parameters: dihStart - Start Date/Time (variant) dihEnd - End Date/Time (variant) Public Function differenceInHHMM(ByVal dihStart As Variant, ByVal dihEnd As Variant) Dim varTemp As Variant, lngHours...
  14. nanscombe

    Are you an atheist?

    History of climate change science From that you could extrapolate that levels should be at pre-industrial levels (say 1850). All we've got to do to achieve this goal is: Get rid of technology that is run by fossil fuel based power. Plant a load of trees that we've destroyed to make room for...
  15. nanscombe

    Possibly a dumb question

    I use Access 2010, but don't have Access 2003 on my computer, but always save files in 2002-2003 format for compatibility. Do you open the samples by simply double-clicking on them? If so, it certainly sounds like you've got the demo Access 2003 (Office 2003) as default for mdb and mde files...
  16. nanscombe

    Error 13 when setting rowsource of combobox using a union query

    You're not the first, and certainly won't be the last, to encounter a problem trying to put a " in the middle of a string. :) Access sees individual " or ' as the start or end of a string. strSQL = "... Like " * " & me.txtSearch & " * " ..." would probably be seen as ... strSQL = "... Like "...
  17. nanscombe

    Error 13 when setting rowsource of combobox using a union query

    I'm just trying a bit of coding trickery to get the relevant bit to be a bit more readable. Dim strSQL as String ... strSQL = "SELECT T1.[Request NLMCID] AS NLMCID," _ & " T1.[Request Display Name] AS [Test Name]" _ & " FROM tbl_Requests AS T1 WHERE T1.[Request Display Name]" _ & "...
  18. nanscombe

    Are you an atheist?

    How and When Did People First Come to North America?
  19. nanscombe

    Error 13 when setting rowsource of combobox using a union query

    Me.cboPTest.RowSource = "SELECT tbl_Requests.[Request NLMCID] AS NLMCID, tbl_Requests.[Request Display Name] AS [Test Name]FROM tbl_Requests WHERE tbl_Requests.[Request Display Name] LIKE " * " & sNewStub & " * " UNION ALL SELECT tbl_ReqAltNames.[Request NLMCID] AS NLMCID...
  20. nanscombe

    Hide Command Button

    Can you get a screenshot, that might help. Does the phrase "no criteria" appear somewhere in your code if you do a search.
Back
Top Bottom