Hi all,
I have the following SQL Insert Into statement and i want to know if I can ConCat txt and another field into this.
Code:
Private Sub CmdSubmit_Click() If IsNull(CboFromAccountID) Or IsNull(CboToAccountID) Then
MsgBox "You're missing some data!"
Exit Sub
End If
Me.TxtTransNumber = [TxtRandom]
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO AccountLedgerTbl (TransID, AccountID, TransDate, TransNumber, Description, Method, Debit) " & _
"VALUES (" & TxtTransID & ", " & CboFromAccountID & ", #" & TxtTransDate & "#, '" & TxtTransNumber & "', '" & TxtTransType & "', '" & TxtMethod & "' , " & TxtAmount & ")"
DoCmd.RunSQL "INSERT INTO AccountLedgerTbl (TransID, AccountID, TransDate, TransNumber, Description, Method, Credit) " & _
"VALUES (" & TxtTransID & ", " & CboToAccountID & ", #" & TxtTransDate & "#, '" & TxtTransNumber & "', '" & TxtTransType & "', '" & TxtMethod & "' , " & TxtAmount & ")"
DoCmd.SetWarnings True
DoCmd.Close
End Sub
In the First Values Row of this code, I want to add to the TxtTransType in this line the Txt "To" and CboToAccountID and then do the same on the second Values Row
TxtTransType in this linethe Txt "From" and CboFromAccountID
This would be like, TxtTransType (Deposit or Transfer or Purchase or Payment) It would put in Description in tbl "Deposit To Bank of America" and "Deposit From Parkway C&A"
rather than just Deposit.... Hope this makes sense. I cant figure out how to ConCat that? Basically i want to know is how do i concat (TxtTransType & "To" & CboToAccountID)
Thanks
Dave