hello
i have the following code but it doesn't work do you where my problem is?
i want that where my name field is empty the value of text0 is replaced with it.
thank you
i have the following code but it doesn't work do you where my problem is?
i want that where my name field is empty the value of text0 is replaced with it.
thank you
Code:
Dim fldEnumeratord As Object
Dim fldColumnsd As Object
Dim dbsd As Database
Dim recsd As Recordset
Set dbsd = CurrentDb
Set recsd = dbsd.OpenRecordset("checks_projects")
Set fldColumnsd = recsd.Fields
' Scan the records from beginning to each
While Not recsd.EOF
' Check the current column
For Each fldEnumeratord In recsd.Fields
' If the column is named Title
If fldEnumeratord.Name = "Project name" Then
' If the title of the current record is "Congo"
If fldEnumeratord.Value = "" Then
' then change its value
recsd.Edit
recsd("[Project name]").Value = Me.Text0
recsd.Update
End If
End If
Next
' Move to the next record and continue the same approach
recsd.MoveNext
Wend
recsd.Close
Set recsd = Nothing
Set dbsd = Nothing