G
Gib
I am trying to change the value of two records in the same
table based on result of a combobox selection.
I have tried with the code below and nothing works. The
lines that are "Comments" are what I tried.
Any suggestions would be welcome!
Thanks
Private Sub BBP_No_BeforeUpdate(Cancel As Integer)
''Dim rs As Recordset
''Dim rs As Variant
Stop
If Me.BBP_No.OldValue Is Null Then
'never mind this is a new entry
ElseIf Me.BBP_No.OldValue = Me.BBP_No Then
'never mind no change was made
Else
''Set rs = OldBBP.RecordsetClone
''Set rs = OldBBP.Recordset
''Set rs = OldBBP
With Me.BBP_No.OldValue
.Find "BBP_No=" & Me.BBP_No.OldValue
.edit
Me.BBP_No.OldValue!Avaliable = Yes 'This is
a yes/no field
.Update
End With
With Me.BBP_No
.Find "BBP_No=" & Me.BBP_No
.edit
Me.BBP_No!Avaliable = No 'This is a yes/no
field
.Update
End With
Me.BBP_No.Requery
End If
table based on result of a combobox selection.
I have tried with the code below and nothing works. The
lines that are "Comments" are what I tried.
Any suggestions would be welcome!
Thanks
Private Sub BBP_No_BeforeUpdate(Cancel As Integer)
''Dim rs As Recordset
''Dim rs As Variant
Stop
If Me.BBP_No.OldValue Is Null Then
'never mind this is a new entry
ElseIf Me.BBP_No.OldValue = Me.BBP_No Then
'never mind no change was made
Else
''Set rs = OldBBP.RecordsetClone
''Set rs = OldBBP.Recordset
''Set rs = OldBBP
With Me.BBP_No.OldValue
.Find "BBP_No=" & Me.BBP_No.OldValue
.edit
Me.BBP_No.OldValue!Avaliable = Yes 'This is
a yes/no field
.Update
End With
With Me.BBP_No
.Find "BBP_No=" & Me.BBP_No
.edit
Me.BBP_No!Avaliable = No 'This is a yes/no
field
.Update
End With
Me.BBP_No.Requery
End If