Greetings,
I'm using the procedure below to insert records into a table which contains a
field (SalesOrder) that must be in the format
8-1
8-2
8-3
8-4
etc.
I placed a MsgBox statement to see the concatenation result which seems correct
but when I look at the result in the table I get
7
6
5
4
The results of a calculation!! I tried various ways using the CStr function
with no success.
8-1= 7
8-2 = 6
8-3 = 5
8-4 = 4
Private Sub cmdInsertRecords_Click()
Dim dbs As DAO.Database
Dim intStart As Integer
Dim intEnd As Integer
Dim intMonth As Integer
Dim intCounter As Integer
intStart = Me.txtStart
intEnd = Me.txtEnd
intMonth = Me.txtMonth
Set dbs = CurrentDb
For intCounter = intStart To intEnd
dbs.Execute " INSERT INTO tblInvoices " & _
"(SalesOrder) Values " & _
"(" & intMonth & " - " & intCounter & ");"
MsgBox intMonth & "-" & intCounter
Next intCounter
dbs.Close
Set dbs = Nothing
End Sub
Any ideas would be appreciated.
Thanks
Ed Marzan
NYC