Change a Error Notice

B

Bob

When I Distribute my Invoices from a holding (Button Code below), my list
box then shows a list of this error #Deleted, but they have just been
moved!
So if 10 Invoices are distributed I get 10 errors #Deleted
Thanks for any Help...Bob

Private Sub cmdDistributeAllInvoices_Click()
Dim nRtnValue As Integer

nRtnValue = MsgBox("Are you sure you want to Distribute All Invoices?" &
vbCrLf & vbCrLf & "If you choose Yes, all the Invoices will have Invoice
Numbers.", vbCritical + vbYesNo + vbDefaultButton2, "Distribute all
Invoices")
If nRtnValue = vbYes Then
DoCmd.Hourglass True
subSetInvoiceValues
Application.SysCmd acSysCmdSetStatus, "Process is completed."
Application.SysCmd acSysCmdClearStatus
DoCmd.Hourglass False
End If
End Sub
 
D

Dirk Goldgar

In
Bob said:
When I Distribute my Invoices from a holding (Button Code below), my
list box then shows a list of this error #Deleted, but they have
just been moved!
So if 10 Invoices are distributed I get 10 errors #Deleted
Thanks for any Help...Bob

Private Sub cmdDistributeAllInvoices_Click()
Dim nRtnValue As Integer

nRtnValue = MsgBox("Are you sure you want to Distribute All
Invoices?" & vbCrLf & vbCrLf & "If you choose Yes, all the Invoices
will have Invoice Numbers.", vbCritical + vbYesNo + vbDefaultButton2,
"Distribute all Invoices")
If nRtnValue = vbYes Then
DoCmd.Hourglass True
subSetInvoiceValues
Application.SysCmd acSysCmdSetStatus, "Process is
completed." Application.SysCmd acSysCmdClearStatus
DoCmd.Hourglass False
End If
End Sub

It sounds like you need to requery your list box after moving the
invoices. I don't know the nameof your list box, but the syntax
(assuming the code is executing on the form containing the list box) is:

Me!NameOfListbox.Requery
 
B

Bob

Dirk Goldgar said:
In

It sounds like you need to requery your list box after moving the
invoices. I don't know the nameof your list box, but the syntax (assuming
the code is executing on the form containing the list box) is:

Me!NameOfListbox.Requery

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
Thanks Dirk that it is working when I distribute my Invoices from button the
same form [frmMainMenu] but when I go to another from to Create new invoices
they do not show on [frmMainMenu] still I close my db and re open it. My
List Box is [lstModify]. This list box is on my MainMenu Open form page or I
think is called a switchboard........Thanks for any help....Bob
 
D

Dirk Goldgar

In
Bob said:
Thanks Dirk that it is working when I distribute my Invoices from
button the same form [frmMainMenu] but when I go to another from to
Create new invoices they do not show on [frmMainMenu] still I close
my db and re open it. My List Box is [lstModify]. This list box is on
my MainMenu Open form page or I think is called a
switchboard........Thanks for any help....Bob

If the list box isn't on the form where the code is running, you have to
get at it via a reference to the form containing it. I'm not sure from
your message what the name of that form is, but you might try

Forms!frmMainMenu!lstModify.Requery

or maybe

Forms!Switchboard!lstModify.Requery
 
B

Bob

Dirk Goldgar said:
In
Bob said:
Thanks Dirk that it is working when I distribute my Invoices from
button the same form [frmMainMenu] but when I go to another from to
Create new invoices they do not show on [frmMainMenu] still I close
my db and re open it. My List Box is [lstModify]. This list box is on
my MainMenu Open form page or I think is called a
switchboard........Thanks for any help....Bob

If the list box isn't on the form where the code is running, you have to
get at it via a reference to the form containing it. I'm not sure from
your message what the name of that form is, but you might try

Forms!frmMainMenu!lstModify.Requery

or maybe

Forms!Switchboard!lstModify.Requery

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
Thanks Dirk I added this to my close button that takes me back to {frmMain}
and it updates that list box on my Main form....Thanks Bob
 
B

Bob

Bob said:
Dirk Goldgar said:
In
Bob said:
Thanks Dirk that it is working when I distribute my Invoices from
button the same form [frmMainMenu] but when I go to another from to
Create new invoices they do not show on [frmMainMenu] still I close
my db and re open it. My List Box is [lstModify]. This list box is on
my MainMenu Open form page or I think is called a
switchboard........Thanks for any help....Bob

If the list box isn't on the form where the code is running, you have to
get at it via a reference to the form containing it. I'm not sure from
your message what the name of that form is, but you might try

Forms!frmMainMenu!lstModify.Requery

or maybe

Forms!Switchboard!lstModify.Requery

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
Thanks Dirk I added this to my close button that takes me back to
{frmMain} and it updates that list box on my Main form....Thanks Bob
Oops Dirk I have a small problem the Listbox [lstModify] it appears on 2
different forms , so how can I combine these 2 scripts so they work, at the
moment I can only get one to show no #Deleted when I delete an Invoice,..
Thanks For any help......Bob

Forms!frmModify!lstModify.Requery
Forms!frmMain!lstModify.Requery
 

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

Similar Threads


Top