Save Record Dilema!

B

Bob Vance

When I create a new Horse Record It is updating my main menu straight away
which is good but if it has no OwnerID it is saving now that I am requiring
my main menu, but if I put the Requery after the Dirty I am getting no
requery to my main menu which is open at the same time, Is there away to get
around this!

Private Sub cmdClose_Click()

DoCmd.RunCommand acCmdSaveRecord
Form_frmMain.cbActiveHorses.Requery
If IsNull(Me.subHorseDetailsChild.Form.OwnerID) Then
If Me.Dirty Then
Me.Undo
End If
If IsNull(Me.subHorseDetailsChild.Form.OwnerID) Or _
(IsNull(tbName) And IsNull(cbFatherName)) Then

If Me.Dirty Then
Me.Undo

End If

End If
End If
End Sub
 
B

Bob Vance

I tried this buts its stalling like it is refreshing my frmMain but its not,
only after I use F5 does it refresh

If IsNull(Me.subHorseDetailsChild.Form.OwnerID) Then

If Me.Dirty Then

Forms("frmMain").Refresh



End If

If IsNull(Me.subHorseDetailsChild.Form.OwnerID) Or _

(IsNull(tbName) And IsNull(cbFatherName)) Then



If Me.Dirty Then

Forms("frmMain").Refresh
 
D

De Jager

Bob Vance said:
When I create a new Horse Record It is updating my main menu straight away
which is good but if it has no OwnerID it is saving now that I am
requiring my main menu, but if I put the Requery after the Dirty I am
getting no requery to my main menu which is open at the same time, Is
there away to get around this!

Private Sub cmdClose_Click()

DoCmd.RunCommand acCmdSaveRecord
Form_frmMain.cbActiveHorses.Requery
If IsNull(Me.subHorseDetailsChild.Form.OwnerID) Then
If Me.Dirty Then
Me.Undo
End If
If IsNull(Me.subHorseDetailsChild.Form.OwnerID) Or _
(IsNull(tbName) And IsNull(cbFatherName)) Then

If Me.Dirty Then
Me.Undo

End If

End If
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top