E
EarlCPhillips
When I click the up/down scroll buttons or scroll bar it often, but not
always, reacts as if I am closing the form and deletes the table rows
prematurely. The form has a close event procedure and uses ADO to delete the
table rows, which works correctly. Does anyone know why the scroll
buttons/bar will invoke the close event procedure and how to stop unintended
table row deletion?
Specifics: I built a form and programmed a table for the local food bank to
help them forcast how many volunteers will be present at a given time on a
given day so they do not book too many volunteers for any time period. The
data source table contains the date, arrival time, departure time and number
of volunteers expected for each group. Using a command button click event
procedure, I read this table, use the hour and minute functions to help
populate an array(25,60) to accumulate the number of volunteers present at
any given 30 minute period from 8AM to 7:30PM for the next 60 days, one date
per row. Since noone could help me address array items within the procedure
directly, I finally used ADO to write a table from that array showing the
accumulated number of volunteers present per day and period. Then I built and
displayed a form in datasheet view from that table in date order. I used ADO
in the form close event procedure to delete the table rows.
Dim objConn As New ADODB.Connection
Dim rsForcast As New ADODB.Recordset
Dim SQLStmt As String
SQLStmt= ""
SQLStmt= "Delete * From tblScheduled Where tblScheduled.dtmDate > (Now()-1);"
CurrentProject.Connection.Execute SQLStmt
What am I doing wrong, or what do I need to change?
always, reacts as if I am closing the form and deletes the table rows
prematurely. The form has a close event procedure and uses ADO to delete the
table rows, which works correctly. Does anyone know why the scroll
buttons/bar will invoke the close event procedure and how to stop unintended
table row deletion?
Specifics: I built a form and programmed a table for the local food bank to
help them forcast how many volunteers will be present at a given time on a
given day so they do not book too many volunteers for any time period. The
data source table contains the date, arrival time, departure time and number
of volunteers expected for each group. Using a command button click event
procedure, I read this table, use the hour and minute functions to help
populate an array(25,60) to accumulate the number of volunteers present at
any given 30 minute period from 8AM to 7:30PM for the next 60 days, one date
per row. Since noone could help me address array items within the procedure
directly, I finally used ADO to write a table from that array showing the
accumulated number of volunteers present per day and period. Then I built and
displayed a form in datasheet view from that table in date order. I used ADO
in the form close event procedure to delete the table rows.
Dim objConn As New ADODB.Connection
Dim rsForcast As New ADODB.Recordset
Dim SQLStmt As String
SQLStmt= ""
SQLStmt= "Delete * From tblScheduled Where tblScheduled.dtmDate > (Now()-1);"
CurrentProject.Connection.Execute SQLStmt
What am I doing wrong, or what do I need to change?