Move Control to another Form Problem

B

Bob

This Control Button I want to move from my MainMenu Form to the form that
contains the the List Box [lstModify], which is where my Invoices sit to be
distributed, When I moved the control I got a yellow error on
{subSetInvoiceValues} 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

David Conger [MSFT]

Does subSetInvoiceValues exist in the same module/class as
cmdDistributeAllInvoices_Click()? If not, you would either need to move
subSetInvoiceValues or reference it by module/class name first
(module1.subSetInvoiceValues).

--
David Conger
Software Development Engineer in Test
Microsoft Office Access

** This posting is provided "AS IS" with no warranties, and confers no
rights. **
 
B

Bob

David sorry its a bit more harder than I thought, I was only trying to move
the command button to another form, think I may leave it on the Main
Menu....Thanks bob

David Conger said:
Does subSetInvoiceValues exist in the same module/class as
cmdDistributeAllInvoices_Click()? If not, you would either need to move
subSetInvoiceValues or reference it by module/class name first
(module1.subSetInvoiceValues).

--
David Conger
Software Development Engineer in Test
Microsoft Office Access

** This posting is provided "AS IS" with no warranties, and confers no
rights. **

Bob said:
This Control Button I want to move from my MainMenu Form to the form that
contains the the List Box [lstModify], which is where my Invoices sit to
be distributed, When I moved the control I got a yellow error on
{subSetInvoiceValues} 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
 
B

Bob

David got it going now moved SubSetInvoiceValues to that form and it is
distributing them, the only thing is now that I am on that form when I
distribute all Invoice they are still visible till I close form and open it
again. is there something I can use to as they disappear from the form when
distributed.....Thanks Bob
I added this Requery bit it slows it down and then shows the words #Deleted#

Blah Blah Blah
Do While Not recDaily_ItMdt.EOF = True
With recDailyCharge
.AddNew
.Fields("InvoiceID") = lngInvoiceID
.Fields("StartDate") =
Nz(recDaily_ItMdt.Fields("StartDate"), 0)
.Fields("EndDate") =
Nz(recDaily_ItMdt.Fields("EndDate"), 0)
.Fields("TotalDays") =
Nz(recDaily_ItMdt.Fields("TotalDays"), 0)
.Fields("DailyCharge") =
Nz(recDaily_ItMdt.Fields("DailyCharge"), "")
.Fields("DailyChargeRate") =
Nz(recDaily_ItMdt.Fields("DailyChargeRate"), 0)
.Fields("DailyChargeAmount") =
Nz(recDaily_ItMdt.Fields("DailyChargeAmount"), 0)
.Update
End With
recDaily_ItMdt.MoveNext
Loop
recDaily_ItMdt.Close
recDailyCharge.Close


Me.lstModify.Requery '*****I added this In*******
Application.SysCmd acSysCmdClearStatus
End Function

Bob said:
David sorry its a bit more harder than I thought, I was only trying to
move the command button to another form, think I may leave it on the Main
Menu....Thanks bob

David Conger said:
Does subSetInvoiceValues exist in the same module/class as
cmdDistributeAllInvoices_Click()? If not, you would either need to move
subSetInvoiceValues or reference it by module/class name first
(module1.subSetInvoiceValues).

--
David Conger
Software Development Engineer in Test
Microsoft Office Access

** This posting is provided "AS IS" with no warranties, and confers no
rights. **

Bob said:
This Control Button I want to move from my MainMenu Form to the form
that contains the the List Box [lstModify], which is where my Invoices
sit to be distributed, When I moved the control I got a yellow error on
{subSetInvoiceValues} 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
 

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

Close a form code! 2
Cant get form to Close 6
Change a Error Notice 5
Message box to appear twice! 10
Default to No 2
Using a Check Box as a Condition 4
Outlook Macro - Help Required 0
Add to a Command Button 6

Top