Read Only, Can't Change Records In Query

Jul 26, 2005

Ok, been puzzled by this one.
I have a form with a subform in it. The subform is based on a query. It shows all my active staff. On the form i have a button that (atleast i would like that it does that) when clicked it sets the field "selected" on true on the subform.

The code behind the button works just fine, but i always get an error stating, can't change data, database or object is read only. Funny thing is, when i click on the checkbox "selected" in the subform behind each staff member, i can set it to true. Why does it not work? I tried it with selecting the query itself (qerWerknemersActief instead of tblWerknemers) and also not working. Here's the code, hope someone has a clue. Oh, in each form everything is set on yes except adding records, so it's not that change records is set to no.

Dim db As DAO.Database
Dim rs As DAO.Recordset

Dim strSQL As Variant


strSQL = "SELECT tblWerknemers.Id, tblWerknemers.Werknemer, tblWerknemers.Selectie, tblWerknemers.Actief " & _
"FROM tblWerknemers " & _
"WHERE (((tblWerknemers.Actief)= True));"


Set db = CurrentDb

Set rs = db.OpenRecordset(strSQL, dbOpenForwardOnly)
Do Until rs.EOF
rs!Selectie = True
rs.MoveNext
Loop

rs.Close
Set rs = Nothing
Set db = Nothing
Call Form_frmBeheerDeelnemers.Requery

View Replies


ADVERTISEMENT

Change Form From Read Only To Edit

Feb 14, 2007

I have a form I open in “Read Only” mode (via a macro). I’d like to add a button to the form that would allow editing of the record (i.e., the default would be "read only" unless the button is clicked).

Thanks,
SKK

View 5 Replies View Related

Modules & VBA :: Change Certain Records Of A Query Or Table

Dec 12, 2013

I want to change certain records of a query or table.Here I tried to change this in a query. Something is missing in my code.

Code:

Public Sub TNS_QUERY()
Dim strSQL As String
Dim x As Double
Dim qdf As QueryDef
strSQL = "SELECT TEST_TNS.[TestID],TEST_TNS.[Division],TEST_TNS.[Customer_Split],SUM([TOTAL_NET_SALES]) as [TNS] " & _
" FROM TEST_TNS " & _
" GROUP BY TEST_TNS.TestID,TEST_TNS.[Division],TEST_TNS.[Customer_Split]"

[code]....

View 7 Replies View Related

Forms :: Change Query To Look At Same Tables On SQL Database / Cannot Add Records

Jun 24, 2014

I am running access 2007 in Win7. I have a time sheet application that I wrote many years ago. Within same I have a button to press to open a new form to enter time sheet data. The data for the form comes from a query that links Employee and the Timesheet history data file.In an effort to upgrade and make the application more portable and available to multiple users, I decided to migrate the data tables to a Microsoft SQL 2012 database. Various Access reports based on the SQL database run ok. But if I try to open a form to add a new record I get the following error message:-
"Run-Time Error '2105' You can't go to the specified record."

If I debug the error it shows:-
Private Sub
Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
End Sub

In an effort to make sure the original time sheet form load worked ok on the original tables, I changed the query to feed off tables in the local Access program and have no issues. It works perfectly. Also if I open the Timesheet Query that feeds the form I can add new records.However if I change the Query to look at the same tables on the SQL database I cannot add records. I can search all records from first to last but not add a record into the query. The add record arrow is greyed out on the query results.

View 5 Replies View Related

Forms :: Change Records Source And Run Query - Onclick Event Of Command Button

Apr 8, 2013

I have a tabbed form in a navigation form with a chart on it. The records source of the chart is a query. The query runs when you click the tab and takes a long time. I changed the Row Source of chart to "" and that eliminates the query running on form load. I've read many posts on changing that row source when a command button is clicked. I tried

Code:
Me!Suspend_Trending_Dashboard![chart].RecordSource = suspend_trend_CHART

in the onclick event of the command button. This doesn't work. I've tried many variations of the syntax. I don't know if I have to tell the query to run after the row source is changed.

On a side note, the query criteria is based on beginning and end dates entered into text boxes on the form. This all works if the query loads when the form is opened.

View 6 Replies View Related

Read Only Effect In Query...

Jun 22, 2005

Hello,
I'm having a little problem with an Access Query. Simple table design, with relationships as normal, using a junction table for a many-to-many link.

Table1
Field: Area (Text)
Field: T1_ID (AutoNumber)

Table2
Field: T2_ID (AutoNumber)
Field: Value (Double)

Table3Join
Field: Area_ID (Long Integer) *Rel: Table1.T1_ID
Field: Value_ID (LongInteger) *Rel: Table2.T2_ID

Table4
Field: T4_ID (AutoNumber)
Field: Area (Number) *Rel: Table1.T1_ID
Field: Description (Text)

Query1
Sources: Table4, Table3Join, Table2, Table1
Fields: Description, Area, Value

SQL:

SELECT Table4.Description,Table4.Area,Table2.Value
FROM Table2 INNER JOIN ((Table1 INNER JOIN Table4 ON Table1.T1_ID = Table4.Area_ID) INNER JOIN Table3Join ON Table1.T1_ID = Table3Join.Area_ID) ON Table2.T2_ID = Table3Join.Value_ID;


However, with this design as it is, I cannot "edit" the Description field, or change the Area field. The entire Query becomes read only. Why is this? And how should i re-write this to allow me to use the relationships which Link Table2.Value to the appropriate Table4.Area (and display them both in one query), while allowing me to edit all the sub fields.

Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner

Using: Access XP 2002 (10.4302.4219) SP-2

View 3 Replies View Related

How To Revert Query From Read Only.

Nov 27, 2006

Hey

I'm having trouble reversing my query from read only. I set the query to read only at first and then decided to reverse this process. However, when i switched back to rewritable mode, the query still dosen't let me edit, add or update data.

Why is this so?

Thanks

View 1 Replies View Related

How Do I Crete Read Only Fields In A Query?

Mar 6, 2007

My problem is as follows:

User group 1 enters information into a table via a form.

This information then needs to be signed off by user group 2. I have created a query which shows the information in fields 1 to 10 which I want to be protected so they can only view this and not edit it and then have a couple of fields at the end where they can enter their name and any comments.

Simply my question is can I have a query with some protected fields and some un protected or is it one or the other? If this is not possible please suggest an alternative.

View 2 Replies View Related

Query Criteria Read From Table

Dec 6, 2011

if there's a way to apply a list of items as criteria in the order listed? Say I've got a list of sales reps and I want a macro to run a query repeatedly, populating one rep from the list at a time in a field called Sales Rep.

View 8 Replies View Related

How To: Access 'Query' Screen In Read-only Mode

Oct 25, 2007

Hi to all,

I would like to ask here for advice on MS Access 2000 application.
When a user logs in, he should be able to use the Access 'Query' screen in read-only mode. In other words, he should be able to generate queries by selecting tables and columns, or using the wizard, but the results of those queries may never have any influence on the data in the database. So: SELECT queries only.
Users should be allowed to execute those queries, but are not allowed to access the tables, forms, or any other items directly.
Is there a way to achieve this?

Thank you


Ori

View 1 Replies View Related

How Do I Update Data Related To A Read-only Query On A Form?

May 22, 2006

Hi all, I'm so tired of looking... please help me!!

I have an Access Data Access Page based on a query which is not updatable.

The query is based on a many-to-many table (e.g. OfficeProducts with foreign keys for OfficeID and ProductID and an Amount field). The query is not updatable as I have included outer joins to the Office and Product tables to get all their records back.

(I'm not sure if I've done this the best way, but need to be able to list all the possible Products for each Office whether they use them or not.)

I want the user to be able to update the Amount field, so e.g. if it is currently set to 50 to be able to change it to 40, or if it is currently null (as there is no record so far for that OfficeProduct) then to insert a record into OfficeProducts with the OfficeID, ProductID and Amount value entered.

I thought this would be straightforward by creating a new textbox in the same section as the current Amount field, calling it NewAmount and letting the user update this, fire an event trigger to either update or insert into the table, and refresh the query and record on the form/DAP so that Amount shows the newly updated/inserted value.

I have been searching for ages... cannot locate either the best event or events to use for this nor the code to enter!! Please please help!!!!!
(This is actually for a charity helping people suffering from emergencies in developing countries, not OfficeProducts, so your spot in heaven will be reserved if you can help ;) Thanks)

Jen

View 4 Replies View Related

Queries :: Query Will Not Read String From (dummy) Textbox

Aug 25, 2013

I have a two-column list box where the user selects multiple Test Names and Test Measures. Through VBA, I loop through and create a string of the selected items and store into two seperate variables, one for each column. I concatenate with the "In" and some parenthesis to end up with the following:

In(ELA,MEAP,Star Math)
In(DRA, Math, PercentileRank)

I place each of the In statements into two seperate dummy text boxes on the form. Then I point the query criteria to these text boxes.

When I run the query, I get nothing. However, if I copy and paste the In statements above from the text boxes directly into the query criteria, I get the desired results.

I changed the code to create an "Or" statement (e.g. "ELA" OR "MEAP" OR "Star Math"), but still the same issue.

why the query will not read from the text boxes on the Form?

View 4 Replies View Related

Queries :: Updating Dates - Query Turned Read Only

Mar 28, 2014

I have a query that i use to update dates relating to jobs and at what stage of development they are in. It worked fine until I started to pull in some data (Prism) to update the user when the project is planned in to sample and when mass production starts (the field this is displayed in is not enabled). when I've incorporated this it I have no longer been able to update any field and my query has turned read only.

SELECT dbo_NPD_Container.PENumber, dbo_NPD_Container.JobNumber, dbo_NPD_Container.ProjectTitle, dbo_NPD_Container.Status, dbo_NPD_Sales.InitialQuery, dbo_NPD_Sales.InitialQueryDate, dbo_NPD_Sales.SpecificationIssued, dbo_NPD_Sales.ApprovalRecived, dbo_NPD_Sales.TuDrawIssued, dbo_NPD_Sales.TuDeliveryDate, dbo_NPD_Sales.TrialRequestIssued, dbo_NPD_Sales.SampleDate,

[Code] .....

View 2 Replies View Related

Modules & VBA :: How To Export A Query To Excel If Access File Is Read Only

Feb 26, 2014

I have an access program that is stored on a SharePoint site. I want to be able to export report to the computer even if I just open the access program as read only. Here's my code:

Code:

Private Sub btnExport_Click()
On Error GoTo btnExport_Click_Err
Dim db As DAO.Database
Dim strSQL As String
Dim qdfTemp As DAO.QueryDef
Dim qryFilter As DAO.QueryDef

[code]...

View 2 Replies View Related

Using A Combo Box To Change Records

May 16, 2006

Hi all,

I was wondering how would we change the forms row source everytime a new new item is selected in a combo box.

For instance here is a table:

ID Name Status
1 Joe Active
2 Fred Inactive
3 Sam Inactive

So if the names were to be displayed in a combo box and the status is represented by a option group. How could I make the combo box change the record instead of having to use the record selector

Any help would be appreciated

thanks

View 3 Replies View Related

Default Value Does Not Change For Old Records

Mar 19, 2014

I have a column for default value of today's date "Date()". In the next column there is formula for no of days which calculates as

No. of days = ([Today's Date] - [Audit Date]/7*5 (/7*5 excludes sat and sunday).

My problem is that default value of date does not change as i open the table everyday. I know why. Coz i introduced the date column after 200 records already entered.

Now today's date only changes if new record is inserted.

How to get current today's date everyday automatically ? when we open the database next day !

note that I am using Today's date only for calculating number of day's formula. otherwise no function of this column.

View 1 Replies View Related

Cannot Be Read: No Read Permissions

Dec 19, 2007

I have a brand new database in-the-works that is causing me headaches. For some reason, if I create a query and then exit and re-enter the database, I cannot re-open that query. I get an Error 3112 (cannot be read; no read permission on <name>) and to contact the administrator or creater of the database.

I'M the creator and the administrator on this thing - so why can't I get into the darn thing? I haven't added any security features. This has never happened before on any database I've created, so obviously, it's frustrating.

Any ideas?

View 3 Replies View Related

Change Values In Several Records At The Same Time

Oct 30, 2005

Hi all!
This is kind of a philosophical question :)

I’m doing some changes to a “CRM”-database, and need to make a function that changes values in several records in one operation. The problem is, I have now idea on how to approach this problem.

One example; I have made a simple invoice function in my db, which works well. But now I send a lot more invoices then when I made the function. I’ve made a form, which prints the invoices, and I can print several in one “operation”. How can I, in the same operation, also change the status of the invoice record so that it says “Printed”?

If you have any suggestions on the method e.t.c.? Thank you!
(I'm using Access 2000)

View 1 Replies View Related

Use Current Date To Change A Value In Records

Aug 12, 2006

I have a db that is a checkbook register. I use a field in each transaction record to tell whether the transaction is current or is a future transaction (if it is in the future then it doesn't yet affect my balance). For instance, if the item is not scheduled to be paid for two weeks (I schedule payments with online banking), I check the "future item" box, then that record for that item isn't included in the report that tells me my current balance. How can I automatically take away that check mark on records when the date in that record becomes todays date (or before today)? Because at that point it is no longer a "future" transaction but is current. I could do this manually but it seems like there should be a way to do it automatically.

View 3 Replies View Related

Delete Or Prevent Records After Cbo Change ?

Sep 5, 2006

Hello, I HAVE searched the forums for many days but I could not find a solution. Maybe I'm not sure what to look for...

The MAINFORM_1(single form view) is based on a Query and has a cbo named 'cbo_client'. This cbo is for a field named [client_id]. The AfterUpdate [event] of 'cbo_client' does a requery on a field in the the following SubForm:

In the SUBFORM_1(datasheet) (based on another Query) is another cbo named 'cbo_subclient', with a select statement of 'Select (all the needed fields) FROM tbl_subclient WHERE ((([tbl_subclient].[subclient_id])=[Forms]![mainform_1]![cbo_client])).

Everything (incl. the REQUERY) works fine, and all the tables gets updated with the records the way it should. No problems.

But this is where i get stuck...: Once the user has entered data in the SUBFORM_1 datasheet, and then >changes the 'cbo_client'< on the MAINFORM_1, it requery the subform like it should, BUT the previously entered data in the subform is already written to the table!

So, I need a way to prevent the data in the subform from beiing stored if the user changes the cbo on the mainform (for a second time). OR prevent the cbo on the mainform from beiing changed after the subform is completed.

I hope you understand what I'm trying to do...

Please, just a point in the right direction and i'll battle it out from there.

Thank you.

View 5 Replies View Related

Queries :: Percentage Change Between Records

Oct 25, 2013

I'm trying to calculate the percentage change between records/rows. I've searched around the internet and found 2 possible examples, but they are very specific to the individual's database and I'm struggling to understand.

Here are two examples:

[URL] ....

[URL] .....

I believe I need to create a query based on another query (which I can do). I would need to create a column in the new query that calculates the percentage difference, but what's the formula/contents of that column?

View 5 Replies View Related

I Need To Change The Enabled Property After Changing Records

Nov 23, 2005

Hi Guys,

i have a problem i hope some one can help me with.

i have a form with a sub form on it, and i want to disable everything until the user clicks a 'edit' button to allow the information to be changed.

i am just testing it at the moment, so i set one text box's enabled property to false. then i added a button with an on click event with the following code:

Me!userid.Enabled = True

when i start the form, the userid box is disabled and when i click on the edit button, it enables it fine.

however, when i change to the next record, the userid box remains enabled. i cant find where to put the code to set it back to false everytime i change the record.

i should also let you know i am a beginner, so please be gentle!

View 2 Replies View Related

Subform Records Change Sort Order

May 8, 2005

I have a subform embedded in a mainform which contains loan payment details over a number of months. The record starts with the payment period number ie 1,2,3 etc. The problem is that every now and again the subform changes the display order of the records so that I get 4,5,6,1,2,3.

When I look at the underlying table the order is OK as is the non embedded sub form. I cannot see any reason for the change and it only happens randomly (apparently).

The numbers are not autonumbering but manually input.
Hope someone can help please.

View 1 Replies View Related

Tables :: Field And All Records Change Same Time?

Mar 12, 2015

I need to change my all field information at the same time. For example :

FIELD
a
a
a
a
a
a

This is my field and i want to change there b instead of a (of course there is 5000 records)

Is that possible ? how can i do that ? or can i change at the same time 1by1 its not an option.

View 2 Replies View Related

Forms :: Change A Field For All Records In Filtered Subform

Aug 3, 2015

I am currently developing a crude Contact manager database and need a quick way of entering data into a selection of records (around 1000 at a time). At the moment I am manually going through all records and changing the "DateLastEmail" field manually, which can be very tiring.

Any way to assign a button to change the field for all records to today's date or something of the like.

Currently I have a form which filters my subform. The subform resides as a seperate query and when the "Apply Filter" button is pressed it requeries with a change of .filter property, so I guess that all that needs to be done is to change all records that exist within the query, but I am stuck on a way to do this without manually entering it.

View 3 Replies View Related

Modules & VBA :: Change Multiple Records On Continuous Form

Mar 5, 2014

I have a form (Form4) which has a a list box (list11) that allows multi select. When I select on the records I need I hit a button that opens a form up with the selected records. This form is a continuous form. I have an unbound combo box (Combo55). Its values come from a specific table. I want to hit a button and change the field "Assigned" on all the records showing to the value that I selected in Combo55.

The problem is it only changes the value of the currently selected record. How Do I get it to change the value of all records that are showing?

I am only testing this idea with default field names. Before I implement the database I have to get a working model and present it. So I am building this and naming at the moment isnt important.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved