E
edisonl via AccessMonster.com
Hi,
This is a strange encounter, I tried to call up a function in event handler
but unable to, more elaborations below.
private sub Password_AfterUpdate()
{
dim rd as adodb.recordset
dim conn as adodb.connection
set rd = .....
set conn = ...
rd.open "employee_table", . . ., . . .
rd.filter . . .
if(Password = rd!password)then
cancelrecord
else
msgbox "invalid password"
endif
}
end sub //end password_afterupdate
// __________________________________
private sub cancel()
{
dim rd as adodb.recordset
dim conn as adodb.connection
set rd = .....
set conn = ...
rd.open "transactions_table", . . ., . . .
rd.filter . . .
msgbox "inside cancel function"
if(transaction_subform!transaction_id = rd!transactionid)then
rd!balance = transaction_subform!taken + rd!balance //restore taken value
to balance
rd!taken = rd!taken - transaction_subform!taken //offset taken
value
else
msgbox "invalid password"
endif
}
end sub //end cancel
_________________________________________________________________________
PROBLEM: a print statement in cancel function is able to generate the output
but
when added the line of rd.open ... cancel() is unable to fire off.
Steps done:
1. Tried changing variables names from rd> rds, conn> con (still unable to
call cancel function)
2. Tried eliminate conn using only rd/rds (still unable to call cancel
function)
Anyone can shed some light ?
Regards & God Bless, Edison
This is a strange encounter, I tried to call up a function in event handler
but unable to, more elaborations below.
private sub Password_AfterUpdate()
{
dim rd as adodb.recordset
dim conn as adodb.connection
set rd = .....
set conn = ...
rd.open "employee_table", . . ., . . .
rd.filter . . .
if(Password = rd!password)then
cancelrecord
else
msgbox "invalid password"
endif
}
end sub //end password_afterupdate
// __________________________________
private sub cancel()
{
dim rd as adodb.recordset
dim conn as adodb.connection
set rd = .....
set conn = ...
rd.open "transactions_table", . . ., . . .
rd.filter . . .
msgbox "inside cancel function"
if(transaction_subform!transaction_id = rd!transactionid)then
rd!balance = transaction_subform!taken + rd!balance //restore taken value
to balance
rd!taken = rd!taken - transaction_subform!taken //offset taken
value
else
msgbox "invalid password"
endif
}
end sub //end cancel
_________________________________________________________________________
PROBLEM: a print statement in cancel function is able to generate the output
but
when added the line of rd.open ... cancel() is unable to fire off.
Steps done:
1. Tried changing variables names from rd> rds, conn> con (still unable to
call cancel function)
2. Tried eliminate conn using only rd/rds (still unable to call cancel
function)
Anyone can shed some light ?
Regards & God Bless, Edison