Search results

  1. Greyowlsl

    Datediff, number of months total

    Hi John, Not quite sure what you mean with the dateserial, these arn't fixed dates. The only thing i can think to solve this is: Dim D_Y as Integer Dim D_M as Integer D_Y = ((Datediff ("yyyy", date1, date2)) - 1) * 12 D_M = (datediff ("m", date1, date2)) + D_Y Just thought there may be some...
  2. Greyowlsl

    Datediff, number of months total

    Hi, I need the number of months in total between two dates, such as 07-2010 with 09-2011 = 14 rather than 2 How would i code this DateDiff("m", date1, date2) Thanks, Leon
  3. Greyowlsl

    Check box problem

    Not really..., can you run old databases in new versions without hastle?
  4. Greyowlsl

    Check box problem

    Hi Linq, I run access 97 so that may be why there is no afterupdate event listed in the event tab. I still however put your code in; unfortunately it still doesn't work. The check boxes all check when i click on any one of them, the txtbox is still empty, and i can't unclick any of the check...
  5. Greyowlsl

    Type Missmatch error

    Thanks Linq! That makes total sence. All i had to do was add an if statement to it, because it should only be running the datediff line if the WARRANTY_RETURNED is NOT null. Now it works! If IsNull(Me.WARRANTY_RETURNED) Then Else: W_C2 = DateDiff("yyyy", [Date recieved], (DateAdd("yyyy", W_C...
  6. Greyowlsl

    Check box problem

    Thanks Linq, I now have:Private Sub Form_AfterUpdate() If Me.chk_breaker.Value = -1 Then Me.UPGRADE_CIRCUIT = "1" Else: Me.UPGRADE_CIRCUIT = "0" End If End Sub and Private Sub Form_BeforeUpdate(Cancel As Integer) Me.chk_breaker.Value = 0 End Sub which im not sure is correct. What this code...
  7. Greyowlsl

    Type Missmatch error

    Hi Linq, 'Date recieved' has been spelt wrong in the database so that isn't the problem. You were right with the 'y', it should be 'yyyy'. My new code looks like this but it still receives the same error on that date diff line. Private Sub Form_Load() Dim W_C As Integer Dim W_C2 As Currency If...
  8. Greyowlsl

    Type Missmatch error

    Only 'me.WARRANTY_RETURNED', but it is linked to a table which has a record, just a blank field under WARRANTY_RETURNED, because that data has not yet been entered. 'Date Recieved' (i know its spelt wrong) has a date in it.
  9. Greyowlsl

    Check box problem

    Hi, Ive searched the forums and access help but i cant find why my code dosent work. The error i get is "you entered and expression that has no value". Private Sub chk_breaker_GotFocus() If Me.chk_breaker = True Then Me.UPGRADE_CIRCUIT = "1" Else: Me.UPGRADE_CIRCUIT = "0" End If End Sub and...
  10. Greyowlsl

    Type Missmatch error

    Thanks missinglinq, Im sure if i did that at the start it would have worked, before i started messing with the null command. The error i have is "invalid use of null" on this line of code W_C2 = DateDiff("yyyy", [Date recieved], (DateAdd("y", W_C, Me.WARRANTY_RETURNED))). If i get rid of all...
  11. Greyowlsl

    Type Missmatch error

    Unfortunately i now have a new problem, there is now an error saying 'Invalid use of null' on that datediff line. This was after i changed If Me.WARRANTY_RETURNED Then Me.warrantycontrol = "No warranty card supplied" to If Me.WARRANTY_RETURNED = Null Then Me.warrantycontrol = "No warranty card...
  12. Greyowlsl

    Type Missmatch error

    Hi, The code below is pretty self explanatory, but i cant seem to get it to work, learning everything from access help so... Private Sub Form_Load() Dim W_C As Integer Dim W_C2 As Currency If Me.WARRANTY_RETURNED Then Me.warrantycontrol = "No warranty card supplied" ElseIf...
  13. Greyowlsl

    Date function not working

    Hi, I have a form that has text box called 'date1', i then have a button called 'todays_date' which on click does 'me.date1 = date' however no date is entered. If i do 'me.date1.setfocus' it gets focus, so why dosent date work? are there any text box properties that could affect this? It works...
  14. Greyowlsl

    Selecting objects in a subform

    Hi, Ide like to know how chnage the color of a text box on a subform when selecting an option in a combo box. This is what i have so far, but it dosen't seem to work. I have also looked at http://access.mvps.org/access/forms/frm0031.htm but it hasn't helped me. If Me.cboTypeOfService =...
  15. Greyowlsl

    Form Screen Position

    Basicaly I want to a form to open at a certain position on the screen. An example file would be nice otherwise easy to follow code. I use Access 97. Thanks for your time and help. Greyowl
  16. Greyowlsl

    positioning a form

    Id'e also like to know this but the code dosen't work for me, i run access 97, an example would be good thanks.
  17. Greyowlsl

    Swine Fever

    Well said, i agree... i just wish i was in the cotton mask manufacturing business... :P
  18. Greyowlsl

    Spam

    Spam... -.-
  19. Greyowlsl

    Rounding numbers in formula

    Hi, I have a cell that has a formula (lets say the result number of the formula is 50.5) The actual number in the cell is however is shown as 51 (due to cell formating) Now my problem is that the next cell formula requires whole numbers to work. So my question is what do i put in my formula...
  20. Greyowlsl

    Linking textboxes from 2 different forms

    Hi, The code below slightly works, when i run the code it formulates strange numbers like 25.321 and so on, when it should simply be 10 or 15 or so on since the numbers that should be multiplied are 2*5 and 3*5 etc. Private Sub MinStockBtn_Click() 'Refresh command: DoCmd.RunCommand...
Back
Top Bottom