Please help me I working on database using access 2003
I'm writing into a save bottom on a form this code to insert some of my value on another table ...no relationship between them
Expand|Select|Wrap|Line Numbers
- If (CustomerID <> "") Then
- Dim stcriteria As String
- stcriteria = "[customerid]= " & [CustomerID]
- Dim myrs As Recordset
- Dim mydb As Database
- Dim mysql1 As String
- Set mydb = CurrentDb()
- x = DSum("[total]", "[invoicepayment]", stcriteria)
- Me.spayments = x
- mysql1 = "select * from [invoicepayment]"
- Set myrs = mydb.OpenRecordset(mysql1, dbOpenDynaset)
- myrs.AddNew
- myrs![custid] = Me.CustomerID
- myrs![PaymentID] = Me.PaymentID
- myrs![PaymentAmount] = Me.PaymentAmount
- myrs![date] = Me.date
- myrs![Account] = Me.screditinvoices - Me.spayments
- myrs.Update
- End If
myrs![custid]=me.customerid
and i'm sure that the there is a field on table named custid I checked maybe more than 100 times anycommentsssssss plzzzzzzzzzzzzzzzzzz