Search results

  1. S

    Too few parameters expected 4

    Thanks for that. I did manage to get the DLookup working in the end. Admittedly, I don't normally use query defs, more comfortable working with SQL or DLookup. I just wanted to get the SQL to work rather than abandon it and do something more long winded! :)
  2. S

    Too few parameters expected 4

    I know this has been posted many times and I have searched through this site for answers but nothing resolves my problem , especially as "yes, I am providing the parameters from my form!! This is my code: (note the SELECT statement is all on one line in my DB) Dim mysql3 As String Dim myrset3...
  3. S

    Passing variables from form to module

    Don't worry, I commented the Scottish code out!
  4. S

    Passing variables from form to module

    thanks very much for all your help. I have it all working fine now using a combination of your code and my table with bank holidays in. One thing to note though is that the reason I had to use my bank holiday table is that when christmas day and boxing day falls on Sat/Sun i.e in 2004, your...
  5. S

    Passing variables from form to module

    Not sure why but when I import all your coding, tables query etc, I get one less than your database every time. i.e 21 days for Feb instead of 20. Also why do you need the empty tblHoliday???? :confused:
  6. S

    Passing variables from form to module

    thanks but I can't read the DB it says "unrecognised Database format" and I can't import objects from it either. We're a bit behind here and still using Access 97 until we upgrade next week!! any chance of getting a 97 version of it
  7. S

    Passing variables from form to module

    Thanks, got it working but it doesn't work for May 2004 as it says there were 21 working days but there were only 19, May Day on 3 and spring Bank holiday on 31. Also December 2004 says 23 days instead of 21 Are these Bank holidays not included? :confused:
  8. S

    Passing variables from form to module

    thanks for your help. Have created a public module called clsHolidays and in my on click event of a button on my form I have added: Dim c As New clsHolidays Me.DaysinMonth = c.DaysinMonth(Me.DISStart) MsgBox (DaysinMonth) Set c = Nothing where DaysinMonth is the control I want to pass the...
  9. S

    Passing variables from form to module

    I have referenced your Bank holiday code but a) I don't really understand what it is doing (and I like to understand the code and b) I have put the code: Public Enum Dates vbNewYear = 1 vbChristmas = 2 vbBoxingDay = 3 End enum into the general...
  10. S

    Passing variables from form to module

    Thanks, I will reference that but I still need to know how to pass the variable controls accross as this always happens when writing vba code and I really need to know how to do it!
  11. S

    Passing variables from form to module

    I have the following module which correctly calculates the number of working days in a given month and accounts for Bank holidays by referencing a table within my DB. this all works fine when you run it direct from the module. However I am struggling to change the module so that it can be...
  12. S

    Prevent Opening Form if Record in Use

    Bear in mind that this will only work if the criteria for making the field required is static. It may be that fields are required dependent on the data entered in other fields
  13. S

    Prevent Opening Form if Record in Use

    Another way round the field data problem, is to ensure that records cannot be saved unless certain mandatory fields are fill in . You can do this easily by using vba with a save button on the form. I have a record ID which is generated by the database when a new record is entered, if mandatory...
  14. S

    Corruption in 2002 databases

    :( Has anyone else experienced problems with 2002 databases keep closing down and corrupting? I have created a brand new DB but it keeps closing down and now it is corrupted beyond repair. I've tried re-importing tables etc into a blank database but it won't import the modules etc as it says...
Back
Top Bottom