doran_doran
Registered User.
- Local time
- Today, 02:37
- Joined
- Aug 15, 2002
- Messages
- 349
Can someone please verify my update code? this is behind form close. When closing the form I want system to look for empty field in ga_record_id_2 (text) and if it's empty then copy ga_record_id to ga_record_id_2.
When I run the sql in a seperate query it works. But it does not work in the form.
=============================================
Private Sub Form_Close()
Dim db As DAO.Database
Set db = CurrentDb()
If Me.GA_Record_ID_2 = "" Then
db.Execute "update tbl_groups " _
& "SET [tbl_groups].[GA_Record_ID_2] = [tbl_groups]![ga_record_id]" _
& "WHERE (tbl_groups.GA_Record_ID_2) Is Null;"
End If
db.close
set db=nothing
End Sub
=============================================
Thanks / Dianna
When I run the sql in a seperate query it works. But it does not work in the form.
=============================================
Private Sub Form_Close()
Dim db As DAO.Database
Set db = CurrentDb()
If Me.GA_Record_ID_2 = "" Then
db.Execute "update tbl_groups " _
& "SET [tbl_groups].[GA_Record_ID_2] = [tbl_groups]![ga_record_id]" _
& "WHERE (tbl_groups.GA_Record_ID_2) Is Null;"
End If
db.close
set db=nothing
End Sub
=============================================
Thanks / Dianna