Updating Subforms As Data Is Added/deleted

Sep 6, 2005

I'm new to form design and do not know any VBA (but that won't stop me from messing with the code when need be).

I'm creating a form that will serve as the user-interface for viewing, adding, and deleteing data.

The product I want is a form with 3 items: a subform that displays data in a table (so users can see all the data), a button that links to a second form for adding data, and a button that allows users to delete data.

I've gotten close to accomplishing this with the exception of the delete option. The hang-up is due to the fact that the subform that displays all the data is the output of a query (can't delete data through the query). A friend who used to work with Access years back was trying to solve this issue by writing code that would identify the primary key of the record selected in the subform/query and then adding code that would use this extracted primary key to delete the record in the original table.

This seems like a slightly convoluted approach. Any suggestions how I can get the product I'm looking for?

Thanks,
Phil

View Replies


ADVERTISEMENT

Main Form Got Locked When Added 2 Subforms

Aug 2, 2012

My main form was working fine (I could key in data) until I added two subforms. Now the main form will not accept data, but the two sub forms do accept data. I have searched properties of all forms and queries, and I cannot find any suspects.

View 1 Replies View Related

Updating A Number Field When One Record Is Deleted

Oct 5, 2004

In access (2003) I am setting up a table with Employee # (Pri. Key), senority numbers..and
so on. However I cannot figure out how to reset the senority numbers when one leaves. For example Bob is #235 senority and leaves (By retiring, quits or gets fired)..well Mary was #236 and now should be #235 (because Bob is no longer at the company)..and so on with everyone else below Bob getting their Senority number changed by one.>
Do you have any ideas..I tried autonumber, but it will not do that.

View 3 Replies View Related

Updating Subforms

Sep 15, 2006

I have a form with a subform. The subform displays the results of a query, as a datasheet view below the items on the main form (i.e. it's effectively a copy of what you can see if you open up the query itself in datasheet view, but neater because it's in the same window).

The query changes frequently to include different fields. Is there a way that I can make the subform update so that it always shows all the fields that the query contains?

At the moment I can't find a way to do this: the subform always tries to display the fields that the query had in it when the subform was created and, if those fields are no longer there, it just puts #!Name in the field!

Thanks in advance if anyone can help.

Gary

View 7 Replies View Related

Forms :: Updating Records When Using Subforms

May 10, 2014

I created a new form with two subforms. They each reference their own table but are linked by a field called Case_Name. I created a unbound combo box in the main form to allow filtering of the records based on Case_name and I do a requery when the record is found. I am importing data from another application into the three tables ( main with other fields, as well as other tables ..Case_Name only).

The form/subforms are then used to modify or add new data to the existing records in each table/subform. The problem I have is when I go to update/add data in the subforms, it comes back and tells me that it cannot add data due to data integrity. It thinks I am trying to add a new record with the same Case_Name. I have the forms and subforms set up as Data Entry = No so that no new records can be added. I only want to modify existing data as the records are created from the import process.

View 5 Replies View Related

Forms :: Adding Records - Tabbed Subforms Not Updating

Oct 10, 2014

I have a form with a tabbed area, each tab containing a subform. One of these subforms adds records to a table. Another subform shows the totals from that table.

But when I add records, the totals tab is not updated with the new quantities unless I close the form completely and go back in. I tried adding Me.Dirty = False to the subform that adds the records but that makes no difference.

It seems as though the 'totals' subform gets those values as the form is loaded and does not change, even when records are added and then that tab is selected.

How can I get the totals subform to show the updated totals?

View 5 Replies View Related

Updating FE Fields When Fields Are Deleted From The BE (after DB Split Obvs)

Aug 28, 2006

Hey,

The database I am working on, I split a while ago to give it some security. Now i'm updating a related form, and i'm finding that if I delete and add fields in the BE, the FE fields (being the fields that I need to insert into the form so the data entered propogates to the DB) are not updated.

How do I update the FE?

Thanks.

View 1 Replies View Related

Recovering Deleted Data

Jan 4, 2007

Hi all,

I have deleted certain content from a table. After it I have compressed and repaired the database but later I found out that I need those deleted data. But now they are gone. Is there any possibility to recover it? Are there any tools or something?

Thank you very much for your help.

View 1 Replies View Related

Recover Deleted Data

Jan 4, 2007

Hi all,

I have deleted certain content from a table. After it I have compressed and repaired the database but later I found out that I need those deleted data. But now they are gone. Is there any possibility to recover it? Are there any tools or something?

Thank you very much for your help.

View 2 Replies View Related

Queries :: Why Is Data Being Deleted

Jan 30, 2014

I have the following set up:A table in access for PurchaseOrders

-A table in access for ShipmentDetails, PK linked to PurchaseOrders OrderNumber
-A table in access for payments, an index linked to the PurchaseOrders OrderNumber
-An SQL database table of purchase order details from our existing system, linked to PurchaseOrders OrderNumber

Now, I create a new record in PurchaseOrders with OrderNumber="ABCD01". All good.I create a new record in ShipmentDetails with OrderRef= "ABCD01". Still good, creating a form and adding fields shows the data is linked correctly.

I now add the CreditorCode field from the linked SQL DB, it automatically shows like it should.I try to use the form to delete the "ABCD01" record from the PurchaseOrders table and it deletes the record FROM THE SQL DATABASE! It's basically acting like Enforce Referential Integrity is turned on with deletes. This backend DB is used by other programs. I don't ever want my app to modify it.

View 4 Replies View Related

Modules & VBA :: Is Deleted Data Recoverable

Jun 25, 2013

I had an inquiry from a semi paranoid client regarding retrieval of deleted data within an Access mdb. In Windows if you delete a file from the hard disk then most probably this file is only marked as deleted, but is not actually deleted until something is written over he space that the file occupied and is recoverable.

In an Access mdb file if we delete a record and do not perform any write action, is there any chance that the deleted record is only marked for deletion and can be recovered? Would compact make the deleted record non-recoverable? Is there any other way to make sure that when something is deleted that it is not recoverable?

View 3 Replies View Related

Imported Data Gets Deleted Automatically?

Oct 1, 2015

Am trying to import data into a blank database (MS access 2013). The import operation is successful. But the data in the tables gets deleted after a while. And all I can see are blank tables in Access 2013.

View 2 Replies View Related

Can I Get Back Data Deleted By A Deleate Query

Feb 7, 2008

I accadentally deleted data when I ran a delete query. Is there any way of retrieving this data?

Thanks

Jamie

View 2 Replies View Related

Queries :: Cannot Assign Any Data Values To New Field Added To Query

Aug 12, 2015

Created a new Query (called qry_Temp) from and existing Query (qry_Test that has fields Field1 - Field5) using QueryDef , and inserted a new Field (FieldX) into it (see example below) using the .Parameters property, then opened a Recordset based on the new Query in order to attempt to enter data values into the new Field (FieldX) for each record in the query - but cannot assign any data values to this new Field (but can to the existing fields) in the new Query?

Dim DB As Database
Dim rs As DAO.Recordset
Dim qdfNew As QueryDef
Dim strSQL1 As String
Dim strSQL2 As String
Dim Value1 As Integer

[Code] ....

View 6 Replies View Related

Forms :: Deleted Appears In Data Entry Fields

Aug 6, 2013

On a data entry form bound to a single table, there is a subform displaying all the records in the source table.If the user accidentally adds a record that they didn't mean to add (or if I add a record to test the form's functionality), and then right-click and delete the record, "#Deleted" appears in all the input controls.

View 5 Replies View Related

Access 2000 - Previously Saved Data Will Be Deleted

Aug 13, 2013

i am programmer i do a project on vb.6.0 and ms access 2000

PROBLEM 1). .if i try to save data on the database its successfully saved but previously saved data will be deleted.

PROBLEM 2). if i add large number of data on database but its not increasing and constantly on 18 numbers.

View 4 Replies View Related

Queries :: After Importing Data Query Not Picking Up Newly Added Records

Apr 21, 2013

I created a database. exported some Excel data into Access tables, created a number of lookups, default values etc. and created a pretty simple query.

My problem is that after importing and tweaking the data, when I add new records, my queries do not pick them up!
I have tried:

1. saving, closing, opening and re-running the queries.
2. putting an Nz expression for each field in the query as I read that null values may cause a problem.
3. wrote the query again, field by field to see if all records were received.
4. Exported the table back to Excel and imported to a new Access table in my database

None of this works.

View 7 Replies View Related

Forms :: Deleting Subform Data When Main Form Is Deleted

Dec 9, 2014

I have a main form with several linked by ID worksheet sub-forms. I would like to add a on-click function to delete the main form and all related record on each sub-form. I have tried several methods but nothing is working correctly. The cascading delete function is not available as part of the form relationships. How I can accomplish this?

View 1 Replies View Related

Forms :: Newly Added Values In Combo Box - Streamline Data Entry With Auto-populated Fields

Jun 24, 2014

I have a combo box that pulls account name data from tblAcctInfo. the combo box has an OnChange event which updates a textbox, txtAcctAddr.

when i have a new account that i would like to be listed in the combo box, i use a form, frmAcctAdd, to add a record to tblAcctInfo.

what i would like to do, is:
1) when i type a new value in the combo box that isn't in the list, have that string value pre-populate in the frmAcctAdd.
2) when i have added the new account info into frmAcctAdd and then saved the record, i would like the new value to pre-populate in the combo box, with the txtAcctAddr textbox also updated via the OnChange event (or maybe a different event is more appropriate?).

I have created a long version of this which requires a lot more user interaction (1-user typing in a new value into the combo box, 2-user RE-typing the SAME value into a data entry form, frmAcctAdd, 3-user saving the new record, 4-user re-clicking the combo box and selecting the newly added value) but i am trying to streamline the data entry with auto-populated fields.

View 6 Replies View Related

Add Data From Two Subforms Into One Record.

Sep 9, 2005

I have two subforms on a tabbed page. Both subforms read/write data from the same table. The first subform is in dataset view and consists of 5-6 fields on the line containing class information. The second subform consists of two memo-type fields where users can enter comments. The fields from both subforms should be written to the same record in the table. The problem is that
the information from the second subform is being written to a different table record; it is creating a new autonumber. The data is being written to two separate records instead of being combined into one.

How do I link the two subforms so that the data gets written to the same record in the table so that the class information and it's related comments stay together?

View 1 Replies View Related

Tabs, Subforms And No Data!

Jul 5, 2006

I have a form with two tabs... Its record source is Person and Account.
The main tab has a load of fields relating to the person and the other tab is meant to show the bank accounts that the person has in a subform. However if there is no bank account for the person then nothing will show in either the subform or on the person tab.

I have checked throughly to see if there is anything saying
SELECT Person.*, Account.* WHERE PersonName = etc
which would only get the account and person details if personname was there.

The form is accessed by means of a search form which opens the form like so.
DoCmd.openForm "PersonAccount", , , "[PersonName] = '" & personName.Value & "'"

So any ideas why nothing at all shows not even the Person details?

View 3 Replies View Related

Forms :: Take Data From A Form With Many Subforms

Dec 6, 2013

I need to take data from a form with many sub-forms. The letter has to be in word to allow for edits. Its an appointment letter, however is has a table with 1-100 lines.I need to be able to add the name, address, date of appointment and table with however many lines are needed for that client.I can get the table to work by itself or the name, address and date of appointment but not both.

View 5 Replies View Related

Handling Errors In Subforms And Clearing Data

Jul 8, 2004

Picking up on some previous conversations with people, I have a form (Interconnect Register) within a database that I am trying to add a "cancel" button to which would close the form without saving. I can do this now, but the problem is there is a subform (Sheetsubfrom) within the main form. I have struggled to get the subform data to clear (was trying to use the DIRTY property but it wouldn't work - believe me, spent ages on it!) but have now got the following in place which I thought would work.


Private Sub Command41_Click()
Dim retval As Integer

'Check main form
On Error GoTo Sub_Form:
Forms![Interconnect Register].SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

Sub_Form:
On Error GoTo Error_Handle:

Forms![Interconnect Register]![SheetSubform].SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
DoCmd.Close

Error_Handle:
DoCmd.Close
End Sub



The problem has come full circle, in that when nothing has been changed ie nothing to cancel, an error occurs saying "nothing to undo". I believe this is something to do with having an error handling procedure nested within another error handling procedure, as from what I can make out from the help files Access backtracks to the level above. So when I have an error in the Sub_Form part, the whole thing crashes.

Any ideas guys and gals? I could try posting then DB on here if that would help, providing I can zip it up ok

Thanks

Ian

View 11 Replies View Related

Forms :: Subforms And Many To Many Relationships - Data Not Retained

Jun 4, 2013

I have created a form with two subforms. The context of this is a litigation database. The main form is for testimony. Among other things, it includes a field for a question and an answer. Any given piece of testimony may relate to one or more documents, and any document may be referenced in one or more pieces of testimony. So have two subforms, one for documents produced by the Plaintiff, and one for documents produced by the Defendant. It worked out easier that way because I originally created indices of those documents in separate Excel tables which I then imported to Access.

So the relationship for both document tables relative to the testimony table is many to many, which is established using two junction tables.

I also have a combo box in each subform where I can autofill fields based on selection of the document number.

My problem is that while the combo-box works great, once I select a document in the subform, that selection is carried over into the next entry of the master form, but also the selection is not retained in any of the master forms. So I can browse the document listing from any entry in the master form, but I can't get the document selection in the subform to stick and create a lasting relationship to a given record in the master form.

Is my problem that it is just impossible to have a subform based on a many to many relationship, or is it in the parent child relationship of the form and subform, or is it in the properties of the subform?

View 13 Replies View Related

Tables :: Corresponding Data In Combo Boxes And Subforms?

Sep 27, 2013

I have a field showing who equipment is being distributed to pulling data from my US Employee table. If I make it to only the last name from my lookup

(SELECT [US Employees].[Last Name], [US Employees].[First Name], [US Employees].[Dept] FROM [US Employees] ORDER BY [Last Name], [First Name], [Dept])

I can also view the equipment listed under the individual it is assigned to on a subform on my US Employee table. If I try to have the first and last name displayed on my Equipment table, however,

(SELECT [US Employees].[Last Name]&", "& [US Employees].[First Name], [US Employees].[Dept] FROM [US Employees] ORDER BY [Last Name], [First Name], [Dept]; )

it will not display under the individual on the US Employee table. Is there a way around this without having to combine the fields on the employee table or separate them on the equipment table?

View 8 Replies View Related

Adding Data To Multiple Tables With Subforms

Mar 2, 2015

I am new to access but I am familiar with SQL databases. I have two tables: one for project data and another for project leader data. These tables are linked by a third table that relates projectIDs to leaderIDs. I am currently working on making a form that will go through each project and display the people involved in each project in a subform. I pulling the data from the the leader table that matches the the projectID with a query.

I would like to be able to update the information in this subform directly (which I can currently do) and be able to add new project leaders to a project. What is the best way to add the new leader to this? If a person is already in the database how do I add them with the form without re-adding new information to the table?

View 3 Replies View Related







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