G
Guest
Hi,
I have a data entry form used for gathering payroll info. I have code in the
Before Update event of the form that checks Empl#, BudgetCode, and WorkDates
against a history file to see if that person has already been paid for that
job. I'm OK to that point - my code works. When it finds a record that
matches in history, a msgbox pops up to tell them its a possible duplicate
and check this batch in history. The problem is that there are legitimate
reasons that a person could have more than one pay record on a particular day
so I have to be able to bypass this. I want a vbRetryCancel msgbox to return
focus to the WorkDate field if they hit retry but accept the record and go to
the next record if they hit cancel. I can get the set focus part but I can't
get it to go to the next record. DoCmd.GotoRecord ,, New Record gives me a
runtime error saying I can't go to that record. (Because the form is
DataEntry??) I can get passed the warning but I have to manually move to
another field and hit enter a couple of times when the msgbox pops up again
but it will eventually go to the next record - of course this looks sloppy as
hell. What am I doing wrong here? How can I get to the next record when they
hit cancel?
TIA
Lynne
I have a data entry form used for gathering payroll info. I have code in the
Before Update event of the form that checks Empl#, BudgetCode, and WorkDates
against a history file to see if that person has already been paid for that
job. I'm OK to that point - my code works. When it finds a record that
matches in history, a msgbox pops up to tell them its a possible duplicate
and check this batch in history. The problem is that there are legitimate
reasons that a person could have more than one pay record on a particular day
so I have to be able to bypass this. I want a vbRetryCancel msgbox to return
focus to the WorkDate field if they hit retry but accept the record and go to
the next record if they hit cancel. I can get the set focus part but I can't
get it to go to the next record. DoCmd.GotoRecord ,, New Record gives me a
runtime error saying I can't go to that record. (Because the form is
DataEntry??) I can get passed the warning but I have to manually move to
another field and hit enter a couple of times when the msgbox pops up again
but it will eventually go to the next record - of course this looks sloppy as
hell. What am I doing wrong here? How can I get to the next record when they
hit cancel?
TIA
Lynne