473,322 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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_Click()
' Open Form
'DoCmd.OpenForm "frmCHAR2", acNormal, , , acFormEdit
'Set Value ID
'Forms![frmSERVICES1]!Survey_ID.Value = Me![Survey_ID].Value
'Close Form
'DoCmd.Close acForm, "frmSERVICES1", acSaveYes
'End Sub

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

Jun 27 '08 #1
5 1553
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.com" <u40920@uwewrote in message
news:85cfb2f666843@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_Click()
' Open Form
'DoCmd.OpenForm "frmCHAR2", acNormal, , , acFormEdit
'Set Value ID
'Forms![frmSERVICES1]!Survey_ID.Value = Me![Survey_ID].Value
'Close Form
'DoCmd.Close acForm, "frmSERVICES1", acSaveYes
'End Sub

--
Message posted via AccessMonster.com
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, "frmSERVICES1", acSaveYes
'End Sub
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200806/1

Jun 27 '08 #3
Musa via AccessMonster.com 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_Click()
' Open Form
'DoCmd.OpenForm "frmCHAR2", acNormal, , , acFormEdit
'Set Value ID
'Forms![frmSERVICES1]!Survey_ID.Value = Me![Survey_ID].Value
'Close Form
'DoCmd.Close acForm, "frmSERVICES1", 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",,,,acFormAdd
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.com 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_Click()
' Open Form
'DoCmd.OpenForm "frmCHAR2", acNormal, , , acFormEdit
'Set Value ID
'Forms![frmSERVICES1]!Survey_ID.Value = Me![Survey_ID].Value
'Close Form
'DoCmd.Close acForm, "frmSERVICES1", 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",,,,acFormAdd
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.com" <u40920@uwewrote in message
news:85d048152f406@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.Close acForm, "frmSERVICES1", acSaveYes
'End Sub

--
Message posted via AccessMonster.com
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
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...
6
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...
1
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...
1
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...
8
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...
2
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...
38
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
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...
0
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...
3
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.