On a subform I have a button that has code for its click event. This button reappears for each record. (btnPrintInvoices). There are 4 other forms just like this, these too will be need to be called at the same time (the loop)
I also have a public function for this event and for each other button one of the other 4 subrforms.
Public Function fTriggerInvoiceBtn()
Call btnPrintInvoices_Click
End Function
On the main form, I have button that needs to 'trigger' each of these buttons as many times as there are records on each subform. The code I currently have is:
Dim rs As DAO.Recordset
Dim db As DAO.Database
Set rs = db.OpenRecordset(Me![Invoices_tbl subform].RecordSource, dbOpenDynaset) 'my subform
With rs
Call btnPrintInvoices_Click ' the button I am calling - this does not work so I tried...
Me![Invoices_tbl subform].Form.fTriggerInvoiceBtn ' this does not work either
Do Until .EOF
.MoveNext
Loop
End With
What is wrong with this loop?
What needs to change in the above scenario?
I am sorry I am so thick! I am rather new to programming and your help and time is extremely valuable.
I also have a public function for this event and for each other button one of the other 4 subrforms.
Public Function fTriggerInvoiceBtn()
Call btnPrintInvoices_Click
End Function
On the main form, I have button that needs to 'trigger' each of these buttons as many times as there are records on each subform. The code I currently have is:
Dim rs As DAO.Recordset
Dim db As DAO.Database
Set rs = db.OpenRecordset(Me![Invoices_tbl subform].RecordSource, dbOpenDynaset) 'my subform
With rs
Call btnPrintInvoices_Click ' the button I am calling - this does not work so I tried...
Me![Invoices_tbl subform].Form.fTriggerInvoiceBtn ' this does not work either
Do Until .EOF
.MoveNext
Loop
End With
What is wrong with this loop?
What needs to change in the above scenario?
I am sorry I am so thick! I am rather new to programming and your help and time is extremely valuable.