Can somebody please help me create a loop from the
following code. At the moment the code only adds
one record at a time from the subform table.
Private Sub Command0_Click(0)
following code. At the moment the code only adds
one record at a time from the subform table.
Private Sub Command0_Click(0)
Dim rdoConn As RDO.rdoConnection
Dim rdoEnv As RDO.rdoEnvironment
Dim rdoEnvs As RDO.rdoEnvironments
Dim rdoRS As RDO.rdoResultset
Dim strsql As String
Set rdoEnvs = rdoEngine.rdoEnvironments
Set rdoEnv = rdoEnvs(0)
rdoEnv.CursorDriver = rdUseServer
Set rdoConn = rdoEnv.OpenConnection("", rdDriverNoPrompt, False, "DSN=CNL;UID=LN;PWD=")
strsql = "SELECT * FROM CustPriceList"
Set rdoRS = rdoConn.OpenResultset(strsql, rdOpenKeyset, rdConcurLock)
rdoRS.AddNew
rdoRS("CustCode") = Me.sfAddCodes.Form.Cust
rdoRS("CodeID") = Me.sfAddCodes.Form.Code
rdoRS("Price1") = Me.sfAddCodes.Form.NewPrice1
rdoRS.Update
rdoRS.Close
rdoConn.Close
rdoEnv.Close
End
End Sub