Using a tab control

fatboy95

Registered User.
Local time
Today, 18:49
Joined
Apr 2, 2002
Messages
43
I am using the following code to delete some info from one of my forms and it works fine when the form is alone.

If IsNull([Forms]![qryMType]![qryMissileInfo Subform]![ComboPartName]) Or [ComboPartName] = "" Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Else
MsgBox "You still have Parts On Order for this Missile!"
End If

When I put the form into a tab control it gives me the following error:

cant find qryMType referred to

I have done a search and haven't been able to find any info on this.. I figure that I have to referrence the tab control some how but I am not sure how to.

Thanks again!
 
I figured it out. I didn't referrence the form that the tab control was on correctly...
 
fatboy95 said:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70


That code is obsolete and is only included for backwards compatibility with ancient databases. It has been superceded by the line: DoCmd.RunCommand acCmdDeleteRecord.
 
I am still having difficulty getting my delete to work. I fixed the link problem but now when I click delete it removes it from my form but not from my database. Not sure what is causing this other than maybe my relationships. I checked them and they all seem to be set correctly for deleting. Any ideas?

thanks again.
 
Are you trying to delete an entire record? Do you have enforce referential integrity & cascading delete set in your relationships?
 
Yes I do. I created a delete query that works fine when i run it stand alone but if I attach it to a button on the form it doesn't delete my file from the database. Really strange how it is acting.
 

Users who are viewing this thread

Back
Top Bottom