Manipulating data in textbox with VBA code

F

FR

I am getting ERR 3326 "This recordset is not updatable" when trying to
manipulate data in controls on a form with VBA. The code is in a form module,
examples:

Forms!frmMembership!DateJoined = Date
Forms!frmMembership!DuesAcct = -Forms!frmMembership!CurrDues

What triggers ERR 3326?
 
D

Douglas J. Steele

What usually triggers it is the underlying recordset not being updatable.

Can you make changes not through VBA?

Assuming that the recordset is a query, is the query updatable?
 
F

FR

Douglas J. Steele said:
What usually triggers it is the underlying recordset not being updatable.

Can you make changes not through VBA?

Assuming that the recordset is a query, is the query updatable?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)





Thanks for your response. You were right of course. Some of the fields in the underlying query are not updatable. I guess I am more ignorant than I thought I was. How do you control whether a field or a query is updatable?
 
F

FR

Thank you, the refernce solved that problem. Now I ran into another:

I have a form with all controls (textboxes) updatable manually. When I try
to manipulate data in them by VBA code, e.g.
Me.DateJoined = Date or
Me.MFirst = "Joe"
I get the following error message;
Runtime error:'-2147352567 (80020009)' You can't assign a value to this
object.
Or, if I append .Value to the object's name:
Runtime error:'2448' You can't assign a value to this object.
It almost seems like the evil spirits lurking inside VBA don't want me to
use it.
 
D

Douglas J. Steele

What are Me.DateJoined and Me.MFirst: the names of text boxes on your form,
the names of fields in your underlying recordsource, or both?

If both, change the names of your text boxes, and try updating the text
boxes, not the fields.
 
Top