Recent content by Spyhunter

  1. S

    Calling Code

    thanks once again, i have actually learn't a lot :)
  2. S

    Calling Code

    ok i believe i understand (and listening now) but this code actually now works; Dim DayD Dim d As String Dim i As Integer DayD = Nz(Me.SelectedDay, 1) For i = DayD To 31 d = "[" & "Day" & CStr(i) & "]" .... I just had to refresh the total shown and it changes based on the mosue over...
  3. S

    Calling Code

    ok, then surely : DayD = Nz(Me.SelectedDay, 1) should work as it would equal 1 if null?
  4. S

    Calling Code

    the field has a number that is used, i just want to be able to use that number in a formula in VBA. I don not fully understand why it is not working.
  5. S

    Calling Code

    but the field in question is not set as a double. it's just a 'dd' format ([Forms]![Main]![SubTotals]![CurrentDay])? Also to note that the CurrentDay value is set on the mouse over VBA code on each sub form, so it know what date you user is selecting with the mouse (not pressing button just...
  6. S

    Calling Code

    i know my database is not perfect and slightly designed incorrect but I am working on one problem at a time and the problem I have is the above, just need to get that working then I am going to go through the back end of the database.
  7. S

    Calling Code

    what do you mean?
  8. S

    Calling Code

    here you go - i know some of the stuff is not as itshould be done (don't have a go at me) but I am learning and changing it all the time. By the way your colour changing code didn't work either :( form vba it is testing on is "MainSub10Oct" Run 'Main' to start it. Thanks.
  9. S

    Calling Code

    i don't actually understand why this is still erroring as it should set it to either 1 or 2; Dim dayd If IsNull([Forms]![Main]![SubTotals]![CurrentDay]) = True Then dayd = 1 Else dayd = 2 End If
  10. S

    Calling Code

    same error using any of the above coding.
  11. S

    Calling Code

    everything i try errors the same; dayd = IIf(IsNull([Forms]![Main]![SubTotals]![CurrentDay]), 1, 2) This would supposingly show 1 for null else 2? (note: I change 'SelectedDay' to be dayd)
  12. S

    Calling Code

    LOL I was just typing a similar coding, as below; If IsNull([Forms]![Main]![SubTotals]![CurrentDay]) = True Then SelectedDay = 1 Else SelectedDay = [Forms]![Main]![SubTotals]![CurrentDay] End If But this doesn't work - my concept was to check whether it was null, if so then just to...
  13. S

    Calling Code

    yes but that doesn't help me - it just checks whether its null - i don't understand what I need to do after checking it... so I know its null - doesn't help the end result surely?! Or Am I being think :)
  14. S

    Calling Code

    ok, but what context would i place that in the code, obviously SelectedDay = IsNull([Forms]![Main]![SubTotals]![CurrentMonth]) doesn't work! I understand the concept but not the result yet. Although I do appreciate your help.
  15. S

    Calling Code

    it's on another form but when i remove the SelectedDay = [Forms]![Main]![SubTotals]![CurrentMonth] it stops the error.
Back
Top Bottom