If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Some help with coding in access with VB

Hi guys,

If you can help me I will be very grateful. I work in access and coding with VB but I'm not expert . This is code(below text) for my stopwatch and all work ok, but I need now when I click on cmd buton Pause( in my language Pauza) that ID from table evidencija skeniranja be paused and then other ID when click start that time can go normal but when I click to previuos ID that ID need to be stoped(because I click stop on that ID) but that ID just go to counthing. Can somebody can help me to solve this problem? (

Re: Some help with coding in access with VB

I assume you mean that you are using VBA in Access. I don't do any coding in Access or Office VBA so I'm not sure what is and is not supported. I do know VB very well but VBA is a bit different, even a bit different in each different product.

What is happening now vs what you want to happen?
When is the user clicking each of those buttons?
How many of these are you trying to track at once?

Re: Some help with coding in access with VB

Hi DataMiser,

Yes your totally right and I using VBA in Access and thank you for anyway for help.

What is happening now vs what you want to happen?

Now happening that when one user work in program and when he/she put some parameters in that program and then click on button cmdStart his/her stopwatch counthing when click on button cmdPause than stopwatch stop and also he/she can repause on same button (this is all work perfect for one user) and then enter. All that is going in table with his/her ID( where ID is autonumber). Then when other or second user need to work and put all paramaters in table and when he/she click on button start stopwatch going to counthing and when he/she click on button pause/repause than stopwatch stop. Problem is now: When user 1 (ID) click on cmdpause and user 2 (other ID) work in application user 1(ID) will also pause his/her work and if user 2 click on repause he/she will also start work of user 1(previous ID)

Re: Some help with coding in access with VB

That is one PC, and then when user1 put parameters and then click enter then all parameters what he introduced go into table in Access. When other user seat on same PC(program still working user1), parameters is now empty and user now can work on his project. But problem is that when for example user 1 stop his work because he must go on lunch he also stop time for all users. If you want i will send you access.db on email that you can see from firsthand what is my problem. And if you can solve that i will be very grateful if you can't solve that i will also be grateful because you offered yourself to help me for problem that i have.boj.djurovic@gmail.com this is my email

Re: Some help with coding in access with VB

It appears that the code you have posted does not have anything in it to determine anything related to who is using it. It looks like all it does is updates a couple of display elements while the timer is running and then writes the content of those to the db when the stop button is pressed. If you want to handle multiple running totals then you need separate variables for each of them and you need to be able to identify which user should be associated which each of those so that your code can update the proper var(s) as needed and then write the proper data when triggered. I also notice that your close does nto call the stop code so it would appear that if they close the form without hitting stop that nothing would be written.

Re: Some help with coding in access with VB

Hi DataMiser,

This is program. Now when everything is entered user press the button "Unesi" and all that going to the table. Now again she/he can work normaly on other his/her project. And the problem is just now when that worker press button "pocetak rada(translate start work)" (he must press that button because his/her time need to counting) and if he/she press the button "Previous record" also time for that user continues to counthing. If you can help me just when user press the "previous button" that time not go to counthing if he/she does not want that and if want he/she will press button "Otpauziraj or translated Pause/Repause"

Re: Some help with coding in access with VB

Like I said you need to treat them separately. This would require you to know which user is using the system at any given time and update the tie for that user. You seem to be just adding a new record to the db when stop is clicked and that record does not appear to be linked to any user.

Re: Some help with coding in access with VB

DM can you help me with coding? Hm I think that all need to be linked just with ID. Because time going to the table where ID is primary. And all what need to be done is when that user or ID use the program to the fill information when he/she start program when he/she click on stop that he/she doesn't stop the project of the other ID when she/he click on the previuos buton(to work normaly on his/her project). I will be very grateful if you can help me to code it.

Re: Some help with coding in access with VB

All you are adding is the time, there is nothing there to identify the user. In order to link to the user then you must have the userid as part of the record and you do not seem to have that in there. You are simply adding a new record and I assume your id in that table is auto number so it basically means nothing in terms of which user is using the system.

What is the purpose for this program? Are you wanting to track how much time each user spends on each project or how much time they spend of each day or what?
It would seem that the first thing you need to do is modify your table structure to accommodate the required fields to meet your goals and then add some variables to your program to handle those values. Stuff like UserID, possibly projectID and so on.

Re: Some help with coding in access with VB

DM,

Exactly that. I want to track how much time each user spends on each project. Yes my ID in that table is auto number. This is all perfect work when users use program on their own computer. But i need options that they can use program on just one PC and you told me that now i need to put some new fields userID for example. I send you also pm.

Advertiser Disclosure:
Some of the products that appear on this site are from companies from which QuinStreet receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. QuinStreet does not include all companies or all types of products available in the marketplace.