doran_doran
Registered User.
- Local time
- Today, 07:42
- Joined
- Aug 15, 2002
- Messages
- 349
Hi,
I am using following code to update a field in another table from a form. When end user exit or click save following happens.
Can any please verify and let me know why the update query is not working.
Dim SQL As String, Conn As Connection
Set Conn = currentdb.CreateQueryDef.SQL
'Set Conn = CurrentProject.Connection
If (DLookup("[Participant_Number]", "tbl_groups", "[GA_Record_ID_2] = '" & [GA_Record_ID_2] & "'")) = 0 Or Null Then
SQL = "update [tbl_groups]([participant_number]) values ('" & Me.txtParticipant_Number & "') "
ElseIf (DLookup("[FeePerParticipant]", "tbl_groups", "[GA_Record_ID_2] = '" & [GA_Record_ID_2] & "'")) = 0 Or Null Then
SQL = "update [tbl_groups]([FeePerParticipant]) values ('" & Me.txtFeePerParticipant & "') "
End If
Conn.Execute (SQL)
Conn.close
Set Conn = Nothing
I am using following code to update a field in another table from a form. When end user exit or click save following happens.
Can any please verify and let me know why the update query is not working.
Dim SQL As String, Conn As Connection
Set Conn = currentdb.CreateQueryDef.SQL
'Set Conn = CurrentProject.Connection
If (DLookup("[Participant_Number]", "tbl_groups", "[GA_Record_ID_2] = '" & [GA_Record_ID_2] & "'")) = 0 Or Null Then
SQL = "update [tbl_groups]([participant_number]) values ('" & Me.txtParticipant_Number & "') "
ElseIf (DLookup("[FeePerParticipant]", "tbl_groups", "[GA_Record_ID_2] = '" & [GA_Record_ID_2] & "'")) = 0 Or Null Then
SQL = "update [tbl_groups]([FeePerParticipant]) values ('" & Me.txtFeePerParticipant & "') "
End If
Conn.Execute (SQL)
Conn.close
Set Conn = Nothing