mreference
Registered User.
- Local time
- Today, 15:51
- Joined
- Oct 4, 2010
- Messages
- 137
A forms underlying query (which is a totals query based on a Where argument and the other fields are are set to Expression) will not let me update it.
The form I am uses filter information through combos in the form header and displaysthe results in the continuos forms detail section. This works great.
When these records are selected, I want the fields "datepaid" and "paid" to be populated with todays date and a tick in the box.
It works fine on another form/query but I am not using the same type of query, this query is more complicated.
The code I use on the update button on the form has this code behind it..
But when it runs the .Edit is highlighted in Yellow.
Is there a workaround this that somebody can help me with?
The form I am uses filter information through combos in the form header and displaysthe results in the continuos forms detail section. This works great.
When these records are selected, I want the fields "datepaid" and "paid" to be populated with todays date and a tick in the box.
It works fine on another form/query but I am not using the same type of query, this query is more complicated.
The code I use on the update button on the form has this code behind it..
Code:
Private Sub cmdUpdate_Click()
'Copies a textbox value in the header of a form
'into a field for all records in a continuous form
If MsgBox("Are you sure you want to" & vbCrLf & "update the filtered records" & vbCrLf & "to a PAID STATUS??", vbYesNo + vbQuestion) = vbYes Then
'Cancel = True
With Me.RecordsetClone
.MoveFirst
Do While .EOF = False
.Edit
.Fields("datepaid").Value = Date
.Fields("paid").Value = -1
.Update
.MoveNext
Loop
End With
End If
End Sub
But when it runs the .Edit is highlighted in Yellow.
Is there a workaround this that somebody can help me with?