By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,656 Members | 909 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,656 IT Pros & Developers. It's quick & easy.

Payroll troubles

P: 48
I have frmMain that takes in data about a particular event. Payroll information needs to be automatically calculated from this, but is stored in a different table. So, I included a subform frmPay, to remain hidden (as the user shouldn't be able to access it directly).

When the user puts in the length of time into frmMain, I can round it to the nearest 15 minutes just fine for frmPay. Now, when I want to multiply those hours by their hourly rate, I have two problems:

1) converting time into a multipliable number. I'm currently using this (keep in mind it's accessing a subform):
myTime (as double) = Hour(Me![frmPay].Form.[TotalHours]) + (Minute(Me![Payroll subform].Form.[TotalHours]) / 60)
This works, but I'm wondering if there's an easier way I'm missing.

2) The *rate* value that I need to multiply it by is stored in a completely different table, related by employee. I have no clue how to access the rate in tblEmployee given the employeeID in frmPay with VBA. I know I can just make another subofrm linked by employee that contains the rate, but this seems *really* wrong. Advice?

Also, I'm using the BeforeUpdate event to do the data transfer between frmMain and frmPay and for calculations. If anyone has any advice as to how to make this more efficient, and especially how to address #2 above, please let me know.

As always, I am greatly appreciative of everyone putting in time here to help others.
Aug 9 '07 #1
Share this Question
Share on Google+
2 Replies


P: 48
Once again I find I can't edit/delete my post for some reason....

ANYWAY! DLookup() seems to do the trick. If anyone has any advice as to the overall efficiency for this thing, it would still be appreciated.
Aug 9 '07 #2

Scott Price
Expert 100+
P: 1,384
Once again I find I can't edit/delete my post for some reason....

ANYWAY! DLookup() seems to do the trick. If anyone has any advice as to the overall efficiency for this thing, it would still be appreciated.
Sorry that this post appears to have gotten lost in the confusion :-(

Edit/Delete disappears after an hour I think it is...

As for the efficiency of your code, I don't see anything there that should cause major problems. If it ain't broke, don't fix it !! :-)

Regards,
Scott
Aug 28 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.