I am having trouble with a form i created. It is a form with a grid of an email address book - table. I want to the user an option of deleting names from the grid/table and it works fine when i "Set Delete On" and test it. But when I implement it into the program and call the form from a main program it gives me an error that says "Deleted variable not found". any suggestions
this is the code for the command button that deleted the record:
select emailaddressbook
DELETE FROM emailaddressbook where idemail = temp
thisform.grd_Email.Refresh
like i said, it works stand-alone

Deleted -SQL HELP
Pi314159
How about putting
Go Top
after the delete, but before the refresh.
This will move the record pointer to the top of the table.
Or You could put
go recno() + 1
to move to the next record.
Greg
NotTaken
Is that exactly what the error message is Where is the variable 'temp' being populated
Greg Gum
AlexBB
temp is being declared right above it, im not sure how Grids really work yet but its getting its data directly from a table, I am displaying a command button with the ID field and this is the click method:
temp = emailaddressbook.idemail
select emailaddressbook
DELETE FROM emailaddressbook where idemail = temp
thisform.grd_Email.Refresh
this might look silly but i was worried what kind of results i would get if i had put:
DELETE FROM emailaddressbook where idemail = emailaddressbook.idemail
Blazing Hornet
Try putting
thisform.resfresh()
after the delete command and see what happens.
Greg Gum
Dimmi3
tiger007
I've been placing message boxes around the program to locate the event it Errors on. the init event is clear but when i press the command button i get the error before i get a message box from the buttons click event. are their any events before the command button's click event
Di Wu
I had the columns control source set the command button instead of the email - id's field, the i had the wrong name for the button (DELETE and not Cmd_Delete). so its fixed! However when I delete a field the grids lines disapear, i can fix that by focusing on them with my cursor, does anyone else know how to fix this
mamatham
quame
Hmm, I am not sure where it is coming from, but I would start over with a fresh form and copy and paste from the old to the new and you will probably lose the error.
Greg
Chips_in
select emailaddressbook
DELETE FROM emailaddressbook where idemail = emailaddressbook.idemail
and i still get that error
Hussam44
Try commenting out the delete command and see if you still get the error. It might be coming from somewhere else as "Delete" is not a variable.
if your already on the record that you want to delete, you can use just the command
DELETE
and it will delete the current record.
There is also a
DELETE FOR command that you can use.
Greg Gum