Fill in numbers macro in msaccess
Closed
                    
        
                    akashneelh
    
        
                    Posts
            
                
            11
                
                            Registration date
            Wednesday September 19, 2012
                            Status
            Member
                            Last seen
            January  5, 2013
            
                -
                            Oct  9, 2012 at 04:48 AM
                        
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Oct 10, 2012 at 05:46 AM
        rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Oct 10, 2012 at 05:46 AM
        Related:         
- Fill in numbers macro in msaccess
- Msaccess download - Download - Databases
- Excel online macro - Guide
- Macro for number to words in excel - Guide
- Excel run macro on open - Guide
- Automatically run macro in excel when cell changes - Guide
2 responses
                
        
                    akashneelh
    
        
                    Posts
            
                
            11
                
                            Registration date
            Wednesday September 19, 2012
                            Status
            Member
                            Last seen
            January  5, 2013
            
                    
Oct 9, 2012 at 09:39 AM
    Oct 9, 2012 at 09:39 AM
                        
                    I have found this function .But how to implement this.
Public Sub CreateSequence(ByVal lngStartValue As Long, lngStopValue As Long)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim lngCounter As Long
Set db = DBEngine(0)(0)
Set rs = db.OpenRecordset("Table2", dbOpenTable)
For lngCounter = lngStartValue To lngStopValue
rs.AddNew
rs.Fields("serial") = lngCounter
'---add any other values here if you want.
rs.Update
Next lngCounter
rs.Close
Set rs = Nothing
End Sub
            Public Sub CreateSequence(ByVal lngStartValue As Long, lngStopValue As Long)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim lngCounter As Long
Set db = DBEngine(0)(0)
Set rs = db.OpenRecordset("Table2", dbOpenTable)
For lngCounter = lngStartValue To lngStopValue
rs.AddNew
rs.Fields("serial") = lngCounter
'---add any other values here if you want.
rs.Update
Next lngCounter
rs.Close
Set rs = Nothing
End Sub
                
        
                    akashneelh
    
        
                    Posts
            
                
            11
                
                            Registration date
            Wednesday September 19, 2012
                            Status
            Member
                            Last seen
            January  5, 2013
            
                    
Oct 9, 2012 at 09:45 AM
    Oct 9, 2012 at 09:45 AM
                        
                    Please help me guys
                
                
             
        
    
    
    
    
Oct 9, 2012 at 08:08 PM
Oct 9, 2012 at 11:50 PM
Oct 10, 2012 at 05:46 AM