By developers mode I mean when I start the database by holding left shift, and user mode is when I just click the dile without shift and therefore hide some part for the user.
Okey, I will try the code you wrote as soon as I can. Thank you for your tip!
Yep, the record is getting deleted okey every time. And the subform from where the deleting is being made is presenting the correct information. But, the other subforms still refer to a non existing record, and that causes the problem.
Right now it's really strange. I have a version - 1.3 - that is the base for the not working version of delete. When I change my delete-button with
Forms!Base!Dependencies.Form.Requery and a couple of other changes it works fine in developer mode. The record moves and changes as it should...
I have tried them both.
The strange thing is, I got it to work a while ago when I moved it below SetWarnings. It moved forward in the record in the Dependencies subform. But, when I tried it in safemode it didn't work. And when I tried it again in developmode (?) it didn't work. I got a new...
I missed some parts of my delete routine. I actually have that line already.
This is the complete routine:
Private Sub btnDelete_Click()
On Error GoTo Err_btnDelete_Click
If MsgBox("Delete selected record?", _
vbYesNo + vbCritical, "Delete") = vbYes Then
DoCmd.SetWarnings False...
The problem is that this has to be done from the main form (Base). And in base, nothing is done codewise. It's just a container for the subforms.
Or where in my mainform did you have in mind that I could put it?
BTW, thank you all for helping! Really appreciate it!
The main form doesn't do anything else than to hold my 4 subforms. So, 4 subforms. But I figured that if I solve this for one form, the rest will tag along.
I do this:
Forms!Base!Dependencies.Requery
Base is the main form and Dependencies is the subform B. Subform A is updated properly.
But this doesn't solve it.
Hi,
I have a really hard nut to crack.
Ha have a main form containing 4 subforms in different tabs. From subform A I have a button that deletes a record in a list.
If MsgBox("Delete selected record?", _
vbYesNo + vbCritical, "Delete") = vbYes Then
DoCmd.SetWarnings False...