selsct a field

Y

yousef

I want to change field name or select other feid
I have this cod:
Private Sub Command0_Click()
Dim dbs As Database
Dim rst As Recordset
Dim sql As String
Set dbs = CurrentDb
Dim a As Integer
sql = "select * from Table1 "
Set rst = dbs.OpenRecordset(sql)
Dim taj As Integer
Do While Not rst.EOF
taj = Nz(rst!Field1)
rst.Edit
rst!a1 = taj
rst.Update
rst.MoveNext
Loop
rst.Close
End Sub

taj = Nz(rst!Field1)
I want to change field name â€taj = Nz(rst!Field1)
†for example taj = Nz(rst!FieldName)
Dim a as Integer
a=1

If …. Then
FieldName= “Field†& a+1 rerun field2
..
..
..
..=> taj = Nz(rst!FieldName) rerun taj = Nz(rst!Field2)
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top