var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Really stupid question..
I have a really stupid question and can only think of the sql for this but I'm thinking that it must be possible in VB.
I want to make a command to delete the current record and generate a warning message.
I know its a really stupid question but I just don't know what to do.
If you create a macro that deletes the current record, you'll be able to view the code and learn that way.
I have tried creating a macro but the problem with that is that I get these very strange Error messages all the time. But if I replace the macro's with code the message don't come up.
I just added a button to a form and made sure that the Wizard button was on. The rest is just a case of selecting the options you want: Record Operations, Record Delete. This is the code that it made for me:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Regards - Andy
How do you get the code it makes for you? What do you click to see it?
Ok. Add a button to a form. The Wizard should pop up and present a list of options. Choose Record Operations and then select Record Delete. Now click OK or Finish to close the Wizard.
To see the code, right-click on your button (in Design View) and choose Build Event, select Code and another window should open showing you the 2 lines of code I posted previously.
Hope that helps.
Regards - Andy
In your button_Click event put the next code
DoCmd.RunSQL ("DELETE FROM YourTableName WHERE yourField_id='" & txt_FieldContainingTheSameId & "';")