Hi everyone,
I have the following code on a button "Punch In" on a form for a time clock app- this is in A5v5 b1050 but the problem is not alpha it's me I'm sure.
The e.punch_status.value="I" doesn't work.It generates an error that the field is locked because it is in use by another process and nothing is put in the field. The field Punch_status is on the form and shows in the object explorer.
I can post the form if necessary. I'm stumped (doesn't take much to stump me!)
Thanks in advance for your help.
'Employee enters employee number, if valid can press punch in or punch out
'of not valid empno pops up filtered lookup on employee where current(.t.) and hourly(.t.)
'can double click on name in lookup to enter empno in field.
'Clicking on punch in or punch out is now allowed.
'When click on Punch In:
'Save record in current form.
topparent.commit()
'put value in field DUMHOUR->EMPNO into variable VEMPNO
t=table.open("dumhour")
dim global vempno as c
vempno=t.EMPNO
t.close()
'Find out if employee "vempno" is punched in (employee->punch_status="I")
if Punch_status.value="I" then
ui_msg_box("Punch In?","Your Are Already Punched In!",UI_ATTENTION_SYMBOL)
end
end if
'do nothing if the empno field is blank
if empno0.value="" then
ui_msg_box("Employee Number","You must enter your employee number!",UI_STOP_SYMBOL)
end
end if
'Make an entry in the HOURSPR table
dim tbl as p
tbl = table.open("hourspr",FILE_RW_EXCLUSIVE)
tbl.enter_begin()
tbl.EMPNO = vempno
tbl.DATE_IN = Date()
tbl.TIME_IN = Time()
tbl.enter_end(.t.)
tbl.close()
e = table.open("employee")
e.change_begin()
e.Punch_status.value = "I" 'this doesn't put value in
e.change_end()
e.close()
'clean out dumhour
t=table.open("dumhour")
t.zap(.t.)
t.close()
parentform.Resynch()
I have the following code on a button "Punch In" on a form for a time clock app- this is in A5v5 b1050 but the problem is not alpha it's me I'm sure.
The e.punch_status.value="I" doesn't work.It generates an error that the field is locked because it is in use by another process and nothing is put in the field. The field Punch_status is on the form and shows in the object explorer.
I can post the form if necessary. I'm stumped (doesn't take much to stump me!)
Thanks in advance for your help.
'Employee enters employee number, if valid can press punch in or punch out
'of not valid empno pops up filtered lookup on employee where current(.t.) and hourly(.t.)
'can double click on name in lookup to enter empno in field.
'Clicking on punch in or punch out is now allowed.
'When click on Punch In:
'Save record in current form.
topparent.commit()
'put value in field DUMHOUR->EMPNO into variable VEMPNO
t=table.open("dumhour")
dim global vempno as c
vempno=t.EMPNO
t.close()
'Find out if employee "vempno" is punched in (employee->punch_status="I")
if Punch_status.value="I" then
ui_msg_box("Punch In?","Your Are Already Punched In!",UI_ATTENTION_SYMBOL)
end
end if
'do nothing if the empno field is blank
if empno0.value="" then
ui_msg_box("Employee Number","You must enter your employee number!",UI_STOP_SYMBOL)
end
end if
'Make an entry in the HOURSPR table
dim tbl as p
tbl = table.open("hourspr",FILE_RW_EXCLUSIVE)
tbl.enter_begin()
tbl.EMPNO = vempno
tbl.DATE_IN = Date()
tbl.TIME_IN = Time()
tbl.enter_end(.t.)
tbl.close()
e = table.open("employee")
e.change_begin()
e.Punch_status.value = "I" 'this doesn't put value in
e.change_end()
e.close()
'clean out dumhour
t=table.open("dumhour")
t.zap(.t.)
t.close()
parentform.Resynch()
Comment