Requery to force save record

  • Thread starter hobbit2612 via AccessMonster.com
  • Start date
H

hobbit2612 via AccessMonster.com

Hi I wonder whether someone may be able to help me please.

I am trying to add some code (as seen in the third line below) to a 'Close
Button' to force it to save the records before I use a main form.

Private Sub Close_Form_Click()
On Error GoTo Err_Close_Form_Click
Forms!frmBidDetails.Requery
DoCmd.Close

Exit_Close_Form_Click:
Exit Sub

Err_Close_Form_Click:
MsgBox Err.Description
Resume Exit_Close_Form_Click

End Sub

But all I get is a message to say that the form cannot be found even though I
know the name of the form in the code is correct.

Can anyone help me pleaase?

Many thanks
 
R

ruralguy via AccessMonster.com

Would I be correct to assume the form you are trying to Requery is not the
form where this code resides? You do know that all forms will *always* save a
Dirty record unless you take extraordinary steps to prevent it, right?
 
H

hobbit2612 via AccessMonster.com

Hi,

Many thanks for your reply. I am aware that a form will always save a dirty
record but I'll be honest it is baffling why I have this issue.

The popup form is linked directly to the table. When I update the values on
this form I want it to update the combo box values on a subform which is
linked to the main input form.

All forms are selected via a main Switchboard form. Basicallly unless I
actually close the database down the values in the combo boxes are not
updated, hence why I thought the requery was the way to go.

Hope this helps

Many thanks
Would I be correct to assume the form you are trying to Requery is not the
form where this code resides? You do know that all forms will *always* save a
Dirty record unless you take extraordinary steps to prevent it, right?
Hi I wonder whether someone may be able to help me please.
[quoted text clipped - 21 lines]
Many thanks
 
H

hobbit2612 via AccessMonster.com

Hi, many thanks for the help but I have managed to correct this problem.

Regards
Hi,

Many thanks for your reply. I am aware that a form will always save a dirty
record but I'll be honest it is baffling why I have this issue.

The popup form is linked directly to the table. When I update the values on
this form I want it to update the combo box values on a subform which is
linked to the main input form.

All forms are selected via a main Switchboard form. Basicallly unless I
actually close the database down the values in the combo boxes are not
updated, hence why I thought the requery was the way to go.

Hope this helps

Many thanks
Would I be correct to assume the form you are trying to Requery is not the
form where this code resides? You do know that all forms will *always* save a
[quoted text clipped - 5 lines]
 

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