JamesMcS, I just tried actually using Year(Now) instead of Year(date) in the actual sentence, and it worked!! :)
I didn't even try to use it in the actual sentence the last time, as Year(date) and Year(now) made the same output in an msgbox, so I figured they would be the same.
Thanks a lot...
Both Year(now()) and Year(Date) works fine, no problem there :)
But I need to make the date 01/04/[current year]
I just can't seem to get my dcount sentence to accept any other input that a date enclosed in #'s.
No difference when enclosing it in brackets...
Have to use Year(Date) and not Year() though.
It is working when I am using #Date# instead of Dateserial, so if it is a typo, it would have to be in the DateSerial-part somehow...
Must be another way of creating a date of the current year?
Edit...
Dim Ut_teller_dato as Date
Ut_teller_dato = DateSerial(Year(), 4, 1)
This gives me "Argument is not optional"
Could the DateSerial usage be inaccurate?
edit: DateSerial(Year(Date), 4, 1) works, but now I get "You cancelled the previous operation" when I run dcount...
Still works with...
Ut_telleverk = DCount("[Medlemsnr]", "bestilling_ut", "Nz([Medlemsnr]) <> chr(48) AND Nz([Dato]) Between DateSerial(Year(),4,1) AND Date()")
This line gives me this error though:
"Wrong number of arguments used with function in query expression 'Nz([Medlemsnr]) <> chr(48) AND Nz([Dato]) Between...
Hi! I have a little VBA-line that needs a bit of changing.
It is part of a bigger procedure that calculates how many boats a company has on their docks.
With this code though, I would have to manually go in and change the date every year.
It should preferabelly be counting from the date April...
There is no front end / back end, it's all in 1 file that is stored on a server. The users tunnel inn with remote desktop in multiple sessions. Or atleast that how I imagine it will be, I'm currently in the testing-phase of the DB.
Hi Again :)
I was wondering if anyone knew of any way to prevent a form from updating its content against the tables dynamically?
I have some subroutines that check what values the fields have, and deactivates some of the fields based on the values.
(Every field that is not "0" is deactivated...
To be honest, I didn't quite follow that :p but I think it's working pretty well with the method of substituting the error messages with my own routines.
Just need to get rid of a few new problems, but I have started a new thread for that :p
Thanks for all the guidance people :)
Hi there!
I have a scary problem, I have just redesigned my database for supporting multiple users.
I am currently in the test-phase, where I simply open the database twice (hereby refered to as two sessions), and then I try to produce errors by typing in data in the same records at once.
I...
Seems I have to take to my senses and try to use the integrated record-lock function after all... all I would need is a way to replace the standard message with a function of my own. I know it is possible with error-messages, any chance it could be done with the recordlock-message too?
While programming, I do see what you mean though.
Setting the lock-flag is very easy, but unflagging it is worse.
There is no event that I can see that triggers when you change to another record.
I agree that locking records in random creative ways is risky, but I was planning on simply letting the users automaticly skip the records that are "locked". They aren't really locked, I will just program in a function that makes the db skip those records. That way nothing could really get...
Thanks John :) but my 'booking' system is made in a very weird way, as I just put it together one step at a time without really knowing what I was doing, so I don't think that would be a problem with my db.
I can definately work with the Locked-field solution, now I just need two pieces of...