Move Control to another Form Problem

  • Thread starter Thread starter Bob
  • Start date Start date
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
 
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. **
 
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
 
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
 
Back
Top