Cant delete from list box

ppoindexter

Registered User.
Local time
Today, 08:10
Joined
Dec 28, 2000
Messages
134
News flash! Listbox problema causes Meltdown

Howdy all

i have a form (frm_Delete_Reference) whose purpose is to delete records from a table--a simple task so i thought

Act 1:
tbl_referencelist has 3 fields

fldreferenceid (auto number-Key)
fldreferencetypeid (number)
fldreference (text)

Act 2:
frm_Delete_Reference

control source = tbl_referencelist

combobox 1 - control source=fldreference
textbox 1 - control source = fldreferenceid

Problem: i pick the item from the combo box, click delete, it askes "do you really want to delete this?" i say "heck yeah" and then it procedes to PRETEND to delete the item,,,however when i check tbl_referencelist the item is STILL there....and sometimes i find numbers have replaced items in the fldreference...

also the text box never changes record numbers even though i change the contents of the combo box....

could someone give me an ideal as to what i am doing wrong before this meltdown i am having has me but a puddle on the floor....thank ya'll very much
 
Last edited:
Hi

Couple of points:

Selecting a reference from the combo box won't automatically move you to the correct record - this is why the content of your text box doesn't change.

You say you 'click delete' - does this mean you've create a command button and if so, what code have you put behind it?

shay
 
thanks for your reply

yes i placed a command button (delete) using the wizard

Private Sub Command3_Click()
On Error GoTo Err_Command3_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_Command3_Click:
Exit Sub

Err_Command3_Click:
MsgBox Err.Description
Resume Exit_Command3_Click

End Sub
 
Greetings Pat

thanks for your response!!

I made the changes and i think i am on the right track..had another error but it isnt related to this so as soon as i get this one worked out..i believe it will work

a question though

if the delete wizard writes bad code....is it safe to assume that other code generated by the wizard is faulty as well? such as add new record, save, open form, etc

if so can you tell me what is wrong with it or point me in the direction to find these IMPERFECTION....fixes...

also i remember reading somewhere once that access left off something to do with "dirty" in the code for something..
do you have any ideal what this would be...sorry i cant remember more than that...i am just afraid some of my problems i experience may be due to me relying on access's wizards and such and when probelms occur i spend countless hours tring to figure out what i did wrong....

thanks again and happy new year........
 
Another bit of screwy code that is generated by a wizard is when you create a button to open a form and show all values. The wizard adds a DIM stLinkCriteria line to the code and adds the stLinkCriteria to the DoCmd.Openform command. I always go in an delete this code because it is never assigned and you should never declare a variable and not use it.

I agree with Pat about the cryptic references on the wizard generated delete button. I never use that code.
 
thanks for the information....

at this point with a near completed db
would you suggest leaving the crytptic references as is
or changing
i know the changing is a timely task
however, i dont want problems down the road.....
 

Users who are viewing this thread

Back
Top Bottom