CharlesWhiteman
Registered User.
- Local time
- Today, 12:26
- Joined
- Feb 26, 2007
- Messages
- 421
Each time the code is executed Access asks for the value of each field rather than using the StrStrings. In debug the StrStings show the correct values but dont seem to transmit through to the SQL INSERT INTO part - as below
Dim strSQL As String
Dim StrCompanyCode As String
Dim StrCallReference As String
Dim StrCallDate As String
Dim StrDepartment As String
Dim StrPerson As String
Dim StrCallNote As String
Dim StrResult As String
StrCompanyCode = Forms.frmdatabase.CompanyCode
StrCallReference = DMax("[Call Reference]", "TblCalls") + 1
StrCallDate = Now()
StrDepartment = "Sales"
StrPerson = CurrentUser()
StrCallNote = "Relationship Change"
StrResult = "Note"
Works Fine down to Here
strSQL = "INSERT INTO TblCalls (CompanyCode, [Call Reference], [Call Date], Department, Person, [Call note], Result)"
strSQL = strSQL & " VALUES(StrCompanyCode, StrCallReference, StrCallDate, StrDepartment, StrPerson, StrCallNote, StrResult)"
DoCmd.RunSQL strSQL
Dim strSQL As String
Dim StrCompanyCode As String
Dim StrCallReference As String
Dim StrCallDate As String
Dim StrDepartment As String
Dim StrPerson As String
Dim StrCallNote As String
Dim StrResult As String
StrCompanyCode = Forms.frmdatabase.CompanyCode
StrCallReference = DMax("[Call Reference]", "TblCalls") + 1
StrCallDate = Now()
StrDepartment = "Sales"
StrPerson = CurrentUser()
StrCallNote = "Relationship Change"
StrResult = "Note"
Works Fine down to Here
strSQL = "INSERT INTO TblCalls (CompanyCode, [Call Reference], [Call Date], Department, Person, [Call note], Result)"
strSQL = strSQL & " VALUES(StrCompanyCode, StrCallReference, StrCallDate, StrDepartment, StrPerson, StrCallNote, StrResult)"
DoCmd.RunSQL strSQL