|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Morning All,
I hope someone can help me here... I am trying to fill in the blanks within the records of a table using information already in that table. i.e: I have five records with the same 'premise code' but only on has 'Tier' information - I want to be able to put this information in all 5. I thought I had it with this code but when I run it Access just shuts down on me...program not responding. Could someone have a look and maybe VET my code and tell what what simple thing I am missing. --------------------------------------- Private Sub Tier_Click() Dim db As DAO.Database Dim rs As DAO.Recordset Dim strSQL As String Dim strSQL2 As String strSQL = "SELECT DISTINCT [Premise Code], Tier " strSQL = strSQL & "FROM [Combined List] " strSQL = strSQL & "WHERE Tier Is Not Null;" Set db = CurrentDb Set rs = db.OpenRecordset(strSQL) Do Until rs.EOF strSQL2 = "UPDATE [Combined List] SET Tier='" strSQL2 = strSQL2 & rs!Tier & "' WHERE [Premise Code]='" strSQL2 = strSQL2 & rs![Premise Code] & "';" db.Execute strSQL2 rs.MoveNext Loop End Sub -------------------------------------- Any help would be much appreciated |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Updating records using the results of another Recordset |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|