.Update

J

JGR

This one is eating my lunch!
I have two tables:

tbl1 records events
tbl2 has the list of items that can experence these events

When as item is selected in the combobox the ynAvaliable
value is changed to No for this item in tbl2 with no
problems. but...

If this item is changed the NEW item ynAvaliable is
changed but I can't change the item.OldValue back to Yes.

See code below. All suggestios welcome.

Thanks

Private Sub BBP_No_Change()
Stop
Dim rs As Variant
Me.Avaliable = No
Me.BBP_No.Requery
If IsNull(Me.BBP_No.OldValue) Then
'nevermind
Else
Set rs = tblBBPNo.RecordsetClone
With rs
.Find "BBP_No=" & Me.BBP_No.OldValue
tblBBPNo!Avaliable = Yes
.Update
End With
End If
End Sub
 
G

Guest

In your code you I think you need to set the record set to the edit mode. So where you have "with rs" right under that add .edit .That may fix your problem, it should have given you an error telling you the record set was not in edit mode so it could not be updated.
 
J

JGR

I have not gotten to the .edit problem yet. When it
reaches the 'Set rs= ' statment it crashes with 'Run Time
Error 424 Object Required

I have rs dim as Variant. Is this correct?


-----Original Message-----
In your code you I think you need to set the record set
to the edit mode. So where you have "with rs" right under
that add .edit .That may fix your problem, it should have
given you an error telling you the record set was not in
edit mode so it could not be updated.
 

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