On a default startup form (switchboard) I have a combobox in which one selects the username (bound to StaffNum) and clicks OK to open up the mainform.
On the mainform I have a data entry form that has its DATA ENTRY option set to YES.
for StaffNum field, I set the Default Value as
Expand|Select|Wrap|Line Numbers
- =[Forms]![Switchboard]![cboStaffNum]
Refresh Button Code:
Expand|Select|Wrap|Line Numbers
- Private Sub cmdRefresh_Click()
- Me.Accounts_Totals.Requery
- Me.MMQ_DataEntry.Requery
- Me.lstTotals.Requery
- Me.lstCashinHand.Requery
- Me.lstAccountBalance.Requery
- Call CalculateTotals
- End Sub
- ---
- This routine adds up figure from a column in listbox
- Public Sub CalculateTotals()
- Dim varOutTotal As Currency
- Dim varInTotal As Currency
- Dim varRow As Integer
- For varRow = 1 To (Forms!Totals_By_Date!lstTotals.ListCount - 1)
- varInTotal = varInTotal + Forms!Totals_By_Date!lstTotals.Column(1, varRow)
- varOutTotal = varOutTotal + Forms!Totals_By_Date!lstTotals.Column(2, varRow)
- Next
- Forms!Totals_By_Date!txtPaidOutTotal = varOutTotal
- Forms!Totals_By_Date!txtPaidInTotal = varInTotal
- Forms!Totals_By_Date!txtBalance = varInTotal - varOutTotal
- End Sub
I am not sure as to why I am facing this problem.
Your help is appreciated.