Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cant Change the value if a field in a table!

Status
Not open for further replies.

siebel2002

Programmer
Oct 8, 2001
102
0
0
US
I have a table in my access db that my form is based on. When i open the table to manually set the value of a field I say, location of a particular employee), it lets me. I can close the table and reopen it and see the new value. But.... after closing the table, logging off the database and opening the db again, the changed value is not there! instead I see only the old, original value!!! What is happening? Any ideas? By the way, the db was designed by someone else.Thanks guys.
 
Is the form control bound to the field? Open your form in design mode and click on the control (presumably a textbox) on the form to select it. Right click and select properties from the shortcut menu. Click on the data tab and look at the very first line which is ControlSource. If that line is blank your control is not bound to the control in which case it is being updated by some code somewhere. Click on the other tab to see what the name of the control is on the form and then look for that name in the form's code.

If you want to bind the control to the field, click to the right of the data area for the ControlSource and you should get a drop down list of fields from the form's underlying table or query from which to select.

Hope this helps and good lucK!

 
yes i have done all that.. the question stillis: why cant i edit the value in the table and have it stick? thx!
 
It depends on how you edit it and what the properties are set at. Allowedits must be set to true to edit from a form and the recordset must be editable. Check on allowedits. To edit from VB you must click the edit okay.

rollie@bwsys.net

if you need more help oon this one let me know.
 
Is your form's underlying record set a query or a table? If it is a query, then using Where clause joins instead of For clause joins will cause it to be read only. As an example, let's say you have the following:

InvoiceHeader
InvoiceID
CustomerID
InvoiceAmount

CustomerMaster
CustomerID
CustomerName

This is read only:
SELECT InvoiceAmount, CustomerName
FROM InvoiceHeader, CustomerMaster
WHERE InvoiceHeader.CustomerID = CustomerMaster.CustomerID

This is not:
SELECT InvoiceAmount, CustomerName
FROM InvoiceHeader INNER JOIN CustomerMaster
ON InvoiceHeader.CustomerID = CustomerMaster.CustomerID

Hope this helps and good luck!



 
Hi :

The question stil is : Why cant I go to the table and edit the value in a given field and have it stick?

Thx!
 
Hello Siebel2002,

We're trying to help by pointing out some possible reasons why your problem is happening. Is your form based on a table or on a query? If it is based on a query, could you post the SQL behind the query?

Thanks and good luck!

 
there is a way to ask a recordset if it is editable. It has been a time since I used it but you cannot always tell if a query is updateable - there, I think that is the term. updateable.

msgbox me.updateable may be the way.

rollie@bwsys.net
 
Thanks for all ur feedback .. Still no closer to resolving this..

Will keep u posted when i get a solution..

Thax again
 
Did you ask the field if it is updateable?

If not you can always change it 'under a command' button. Drop me an email for a sample of that.

rollie@bwsys.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top