Hi all,
On my form I have a Combo for accounts. Is ther a way to get this to only be one account as a default or set a value to it on the RunSql statement (Below)?
Code:
Case "Deposit"
If Me.ChkDepositRemburseExp = False Then
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO AccountLedgerTbl (TransID, AccountID, TransDate, TransNumber, Description, Method, Credit) " & _
"VALUES (" & TxtTransID & ", " & CboToAccount & ", #" & TxtTransDate & "#, '" & TxtTransNumber & "', '" & TxtTransType & " From " & CboCompany.Column(1) & "', '" & TxtMethod & "' , " & TxtTransAmount & ")"
'db.Execute strSql, dbFailOnError
Else
DoCmd.RunSQL "INSERT INTO AccountLedgerTbl (TransID, AccountID, TransDate, TransNumber, Description, Method, Credit) " & _
"VALUES (" & TxtTransID & ", " & CboToAccount & ", #" & TxtTransDate & "#, '" & TxtTransNumber & "', '" & TxtTransType & " From " & CboCompany.Column(1) & "', '" & TxtMethod & "' , " & TxtTransAmount & ")"
'db.Execute strSql, dbFailOnError
DoCmd.RunSQL "INSERT INTO AccountLedgerTbl (TransID, AccountID, TransDate, TransNumber, Description, Method, Debit) " & _
"VALUES (" & TxtTransID & ", " & CboRE & ", #" & TxtTransDate & "#, '" & TxtTransNumber & "', '" & TxtTransDescription & "' , '" & TxtMethod & "' , " & TxtTransAmount & ")"
DoCmd.SetWarnings True
End If
The CboRE (in Red) above would be ideal to be able to use for this if possible? This is a combo with all accounts and is hidden on my form. I want to be able to just set that as Remburseable Expenses
so that i dont need to select it. It would always be the same value.... CboRE = Rembursable Expenses
I coule also use the "ChkDepositRemburseExp" check box so that when ticked, it sets that CboRE to Rembursable Expenses
Not sure how to actually do this? I have tried bound and unbound in different combos, have tried a default value however nothing has produced a result. Maybe some type of Qry? I just dont know
Thanks
Dave