Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.
Function MakeData() Dim StrSQL As String Dim db As Database 'Current database. Dim lng As Long 'Loop controller. Dim rs As DAO.Recordset 'Table to append to. Dim lng1 As Long 'Loop controller. Dim rs1 As DAO.Recordset 'Table to append from. Dim ACCOUNT As String Dim YEAR As String Dim USER As String Dim REPEAT As Integer Dim TYPEREC As String 'StrSQL = "Delete * from tblPrint where user =" & fOSUserName() & ";" 'DoCmd.SetWarnings False 'DoCmd.RunSQL StrSQL 'DoCmd.SetWarnings True Set db = DBEngine(0)(0) Set rs1 = db.OpenRecordset("select * from ppPidList2 ;") Set rs = db.OpenRecordset("tblPrint", dbOpenDynaset, dbAppendOnly) Do While Not rs1.EOF ACCOUNT = rs1!ACCOUNT YEAR = rs1!YEAR USER = rs1!USER REPEAT = rs1!REPEAT TYPEREC = rs1!TYPE Set rs = db.OpenRecordset("tblPrint", dbOpenDynaset, dbAppendOnly) With rs For lng = 1 To REPEAT .AddNew !ACCOUNT = ACCOUNT !YEAR = YEAR !USER = USER !TYPE = TYPEREC .Update Next End With rs.Close Loop Set rs = Nothing Set db = Nothing Set rs1 = Nothing Set db = Nothing End Function
|How to execute an access 2007 module from vb6||2||32|
|vba sql wild card passing in code||3||20|
|Trying to open FORM in specific record !!||6||43|
|Cascading Combo boxes between 2 sub navigation forms||1||9|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
10 Experts available now in Live!