473,657 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File cannot be updated

I have the following code to Open a form and set the form to the Survey_ID
from the first form.
I keep get errors like cannot update file --- The Survey_ID is an autonumber.
Could this be the problem ?

Private Sub Command259_Clic k()
' Open Form
'DoCmd.OpenForm "frmCHAR2", acNormal, , , acFormEdit
'Set Value ID
'Forms![frmSERVICES1]!Survey_ID.Valu e = Me![Survey_ID].Value
'Close Form
'DoCmd.Close acForm, "frmSERVICE S1", acSaveYes
'End Sub

--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200806/1

Jun 27 '08 #1
5 1568
JvC
You can't update an AutoNumber field. Changing it to a Number will make it
work. I suspect that in reality you have a design issue here. Can you give
the group a better idea of what you are trying to accomplish?

John

"Musa via AccessMonster.c om" <u40920@uwewrot e in message
news:85cfb2f666 843@uwe...
>I have the following code to Open a form and set the form to the Survey_ID
from the first form.
I keep get errors like cannot update file --- The Survey_ID is an
autonumber.
Could this be the problem ?

Private Sub Command259_Clic k()
' Open Form
'DoCmd.OpenForm "frmCHAR2", acNormal, , , acFormEdit
'Set Value ID
'Forms![frmSERVICES1]!Survey_ID.Valu e = Me![Survey_ID].Value
'Close Form
'DoCmd.Close acForm, "frmSERVICE S1", acSaveYes
'End Sub

--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200806/1

Jun 27 '08 #2
I have 5 tables each with a corresponding form. The forms are for Data Entry
purposes only.
Each record has a Survey_Id that is provided by an Autonumber. The User Adds
a record and enters information starting at Frm1 and ending with Frm5. The
User wants to be able to recall a record to review for errors. I would like
to place a filter so that the User may call up a record.
If I only use the properties option Data Entry yes.. I have no problem. Now
that I want to add a filter so that the User may go back I am running into
all kinds of problems. The ID from the first form is not matching the other
forms On open... Or, the ID matches but there is no information displayed ..
Should I be looking at Subforms ?

Thanks

JvC wrote:
>You can't update an AutoNumber field. Changing it to a Number will make it
work. I suspect that in reality you have a design issue here. Can you give
the group a better idea of what you are trying to accomplish?

John
>>I have the following code to Open a form and set the form to the Survey_ID
from the first form.
[quoted text clipped - 10 lines]
>'DoCmd.Close acForm, "frmSERVICE S1", acSaveYes
'End Sub
--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200806/1

Jun 27 '08 #3
Musa via AccessMonster.c om wrote:
I have the following code to Open a form and set the form to the Survey_ID
from the first form.
I keep get errors like cannot update file --- The Survey_ID is an autonumber.
Could this be the problem ?

Private Sub Command259_Clic k()
' Open Form
'DoCmd.OpenForm "frmCHAR2", acNormal, , , acFormEdit
'Set Value ID
'Forms![frmSERVICES1]!Survey_ID.Valu e = Me![Survey_ID].Value
'Close Form
'DoCmd.Close acForm, "frmSERVICE S1", acSaveYes
'End Sub
If you have a form with the record and want to edit on the second form.
Watch for wordwrap
DocmdOpenForm "frmCHAR2", , , , "SurveyID = " &
Forms![frmSERVICES1]!Survey_ID

If adding, this is one method...no wordwrap
docmd.OpenForm "frmCHAR2",,,,a cFormAdd
Forms!frmCHAR2! Survey_ID = Me.Survey_ID

An easy way.
http://www.youtube.com/watch?v=VJfH6ExfmwM
Jun 27 '08 #4
Salad wrote:
Musa via AccessMonster.c om wrote:
>I have the following code to Open a form and set the form to the
Survey_ID
from the first form.
I keep get errors like cannot update file --- The Survey_ID is an
autonumber.
Could this be the problem ?

Private Sub Command259_Clic k()
' Open Form
'DoCmd.OpenFor m "frmCHAR2", acNormal, , , acFormEdit
'Set Value ID
'Forms![frmSERVICES1]!Survey_ID.Valu e = Me![Survey_ID].Value
'Close Form
'DoCmd.Close acForm, "frmSERVICE S1", acSaveYes
'End Sub
If you have a form with the record and want to edit on the second form.
Watch for wordwrap
DocmdOpenForm "frmCHAR2", , , , "SurveyID = " &
Forms![frmSERVICES1]!Survey_ID

If adding, this is one method...no wordwrap
docmd.OpenForm "frmCHAR2",,,,a cFormAdd
Forms!frmCHAR2! Survey_ID = Me.Survey_ID

An easy way.
http://www.youtube.com/watch?v=VJfH6ExfmwM
I didn't notice you mentioned the Survey ID is an autonumber till later.
No need to assign a value like the second line in the second example.
As soon as you start to enter any data into the form it will create
the value. You might want to open the property sheet for that field in
frmchar2 and if you display it, set the enabled flag to No (and maybe
locked to yes depending on the user interface.

However, if you have Table1 (master) with SurveyID as Autonumber and
Table2 that links to Table1 (child) then you would NOT want SurveyID to
be an autonumber.
Jun 27 '08 #5
If you are saying you have 1 Survey and 5 differernt types of information
relevant to that survey, you shoud be using 5 tables, one for the main bit
of information - SurveyID as the PK Autonumber and possibly Survey details,
Site Address etc and 4 other tables with SurveyID as the foreign key. I
usually give all tables a PK Autonumber, to see if things have been deleted.

Then as you guessed use Subforms (possibly on a tabbed form) to input the
different bits of info.

Phil

"Musa via AccessMonster.c om" <u40920@uwewrot e in message
news:85d048152f 406@uwe...
>I have 5 tables each with a corresponding form. The forms are for Data
Entry
purposes only.
Each record has a Survey_Id that is provided by an Autonumber. The User
Adds
a record and enters information starting at Frm1 and ending with Frm5.
The
User wants to be able to recall a record to review for errors. I would
like
to place a filter so that the User may call up a record.
If I only use the properties option Data Entry yes.. I have no problem.
Now
that I want to add a filter so that the User may go back I am running into
all kinds of problems. The ID from the first form is not matching the
other
forms On open... Or, the ID matches but there is no information displayed
..
Should I be looking at Subforms ?

Thanks

JvC wrote:
>>You can't update an AutoNumber field. Changing it to a Number will make it
work. I suspect that in reality you have a design issue here. Can you give
the group a better idea of what you are trying to accomplish?

John
>>>I have the following code to Open a form and set the form to the
Survey_ID
from the first form.
[quoted text clipped - 10 lines]
>>'DoCmd.Clos e acForm, "frmSERVICE S1", acSaveYes
'End Sub

--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200806/1

Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
17971
by: Ben Schminke | last post by:
I have seen this "field cannot be updated" error on several FAQ's, and but none of the solutions seem to match my situation. I have a form based on a query. When I try to add a new record, this error comes up (twice). After I "OK" it (twice) I can add my record. However, If I add the new records directly to the queries Dynaset there are no problems or errors. I have 2 subforms on the form, but the problem persists when I delete them. ...
6
4067
by: muttu2244 | last post by:
hi all am updating the same file in ftp, through multiple clients, but am scared that two clients may open the same file at a time, and try updating, then the data updated by one data will be lost. So i have to provide some lock mechanism to that file in ftp, so how can i lock it, if one client opens it for updating, so that till it gets relased it cannot be updated by other clients. Could u please suggest me the simple solutions...
1
2359
by: harriegovin | last post by:
Hi, Here is the scenario. I have a web application written in vb.net. One of the functionalities of the application is to save the recordset in an xml format on to the client machine. The xml file needs to be saved on the client machine for the offline application to work. when the user works on the offline module the data in the saved xml file gets updated. The data from the updated xml file needs to be written back to the main...
1
2321
by: Roy | last post by:
Hi, Thanks for helping.I have an A2K Appl.Recently,one of the groups agreed to provide data which I download into the access table.The problem is this data which is sent in a text file.I am unable to import it because of the delimiter tab.The tab is present in places where it is unable to identify one problem ID from the second one.I need help.I am pasting a sample taxt file here. ...
8
1929
by: rdemyan via AccessMonster.com | last post by:
Anyone have any ideas on how to determine when the back-end file (containing only tables) has been updated with new data. The date/time of the file won't work because it gets updated to the current date/time when the back-end file is compacted. I'm just looking for an easy way to determine when there has been a change to data in any table in the back-end file. Maybe something is updated in one of the system tables??
2
151644
by: antonyliu2002 | last post by:
I am testing AJAX. I've downloaded the AJAX Extension and the CTP December package and installed on BOTH my development machine and the production server. Then I created a very very simple web application, which contains a button and a label. When the button is clicked, some message is shown on the label. That's it. The AJAX works great on my development machine, but on the production server, I got the typical error as follows:
38
5059
by: ted | last post by:
I have an old link that was widely distributed. I would now like to put a link on that old page that will go to a new page without displaying anything.
6
2902
by: Peted | last post by:
Hi, im wanting to store some custom text strings in the app.config file of a c# app, to be retreived and updated when the app runs. using c# 2005 express in my testing i am using the code bellow, and its almost idenictal to every web example i have found. They all suggest the values and file can be read from and updated. The code bellow runs, with no errors of
0
960
by: Dmitry Teslenko | last post by:
Hello! I use some script in python 2.5 from vim editor (it has python bindings) that updates some file and then launches another program (ms visual studio, for example) to do something with updated file. I faced problem when updated file is locked for writing until vim editor is closed. launch vim -update file -launch msvc -file locked launch vim -update file -launch msvc -close vim -file locked
3
1720
by: karthikchittur | last post by:
Hello scripters Requirement: I am trying to write a perl script that manipulate a html file. Both the html file and the script are placed at central server. I have scheduled one more script in client PC to run at start-up, that calls this server script with required arguments and the HTML page is updated accordingly. This is not server client architecture but a static server script called from client PC The problem: The scripts I have...
0
8420
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.