Small problem, and I know the solution should be simple.
I have form called frmExpenses
This has a sub form called frmExpenseItems.
In frmExpenseItems is a textbox called totalAmount.
In frmExpenses when user clicks command button, I want to send totalAmount value to an Excel spreadsheet.
The relevant code I have at the moment (which does not work) is as follows
With xlApp
:
:
:
'Add total amount of expense claim to Excel
.Cells(36, 6) = Forms!frmExpenses!frmExpenseItems.totalAmount
:
:
:
End With
The error I get is "Microsoft Access can't find the form frmExpenseItems referred to in a macro expression or Visual Basic Code"
I checked the spelling of the form name and that is correct.
I have tried various combinations of ! and . and [....], but can't for the life of me figure out how to correctly refernce the totalAmount textbox.
Any help greatly appreciated
Gavin
I have form called frmExpenses
This has a sub form called frmExpenseItems.
In frmExpenseItems is a textbox called totalAmount.
In frmExpenses when user clicks command button, I want to send totalAmount value to an Excel spreadsheet.
The relevant code I have at the moment (which does not work) is as follows
With xlApp
:
:
:
'Add total amount of expense claim to Excel
.Cells(36, 6) = Forms!frmExpenses!frmExpenseItems.totalAmount
:
:
:
End With
The error I get is "Microsoft Access can't find the form frmExpenseItems referred to in a macro expression or Visual Basic Code"
I checked the spelling of the form name and that is correct.
I have tried various combinations of ! and . and [....], but can't for the life of me figure out how to correctly refernce the totalAmount textbox.
Any help greatly appreciated
Gavin