General :: Button To Add New Record To Another Table

Jan 19, 2015

I have a form wich users input information into and it goes in one table. Several buttons on my form send a report from that table to people.

What I need to to is that every time one of these buttons are pressed and a report is sent, a timestamp and wich button was pressed needs to be recorded in another table in the same database.

This is because I need to record to whom each report was sent and when.

View Replies


ADVERTISEMENT

General :: Add New Record - Button

Jun 4, 2015

My Add New Record button doesn't work....The backstory is a little complicated but essentially this was an Access 95 database that was upgraded through office 2003 to Office 2007 a few years ago (.accdb converted). The database became corrupted post Office 2010 installations a few weeks ago but today I have loaded a restored database onto an XP Machine with Office 2007 and the same issue occurs (ruling out Office 2010 as the cause).

I have an Add new record button on the form, it doesn't work with the code:

Code:

DoCmd.GoToRecord , , acNewRec

This always brings up the message: "You can't go to the specified record.".I have tried adding a new button to add a record via the wizard, I receive the same results.I have tested adding a record via the table, that works fine.

View 4 Replies View Related

General :: Using Command Button To Save New Record

Dec 7, 2012

I have have a form with 4 subforms in it, one of the subforms is based on a filtered query . For a reason I can not work out I cannot get it to requery when I add a new record.

To add a new record I select from a combo box and use a command button to save the record

I have tried using this in the buttons on click event

Code:
Forms.trialcatalogueF!TrialCompetitorsSF!competitorsSF.Form.Requery

with no result, however it does kinda work in the combo's after update event, just not until I select another value.

View 2 Replies View Related

General :: Button On A Form To Find A Certain Record?

Aug 23, 2012

I have a form [Invoice] with a subform [Orderssubform1] in it and they are both linked with the field 'CustomerID' using a parent and child relationship. I have also established that relationship in the tables too. Using a combo box [Combo0], the user can select a customer from the form and then enter details about the invoice in the subform. They then click 'Generate Invoice' and it creates a report for them. This all works fine.

The problem arises when I want the customer to locate a certain invoice using a button. I would like the customer to be able to click a button on the form which would then bring up a box asking them to enter the invoice number [InvoiceNo] and it would then locate that invoice so they can generate it as a report again. The user can find the customer themselves using the combo box, I just want the record related to that customer to be found using the button.

View 14 Replies View Related

General :: Looping - Button To Move To Next Record

Feb 13, 2015

I have a code that I am currently using with a button to move to the next record. I just want it to loop by itself. I am currently having to press the Update button for it to move to the next record.

Private Sub UpdateAllComments_Click()
Dim memoContent As String
memoContent = Me.Remarks1
If Not Me.Recordset.EOF Then
Me.Recordset.MoveNext
Me.Recordset.EOF

[Code] .....

View 7 Replies View Related

General :: Button To Create Invoice Per Record On A Form

Apr 18, 2013

I am creating a database for a local mechanical garage, most of it is setup but i have an issue creating invoices, I need to create a button on a form which will create an invoice per record. Trouble I am having is if i have 1 record it will show just 1, but when i add multiple records they all show on 1 invoice sheet. It doesn't separate records, i but instead it adds the extra records before the page footer :/ causing 1 footer for many records. How to finish the functionality of this DB, i can certainly finish the design side. Everything in this DB is set accordingly, just the invoice system to do i believe, could some1 have a look and let me know? i have tried to upload it here but cant so its on this link [URL] ....

View 3 Replies View Related

General :: Database To Record Payments - Multi Task Command Button

Apr 7, 2014

I am creating a small database to record payments.

There are three tables :

Supplier - tblSupplier
Payments - tblPayments
Invoice - tblInvoice

There are two Forms :

frmPayments (Bound to tblPayments) - Main Form for payment entry.
frmInvoice Sub (Bound to tblInvoice) - Sub form to display not paid invoices.

What i need is a Command button , lets named it "Commit", to perform a few tasks :

1. When click, prompt message asking whether to Save current payment record when all relevant input is completed during data entry.

2. If Answer is "Yes", then it will compare the "Invoice No" on the Main Form with the "Invoice No" of the Sub

Form , and if found to match, then put a tick in the "Yes/No" field of Invoice Table (tblInvoice) against the matching "Invoice No" of Main Form. This is to record payments made to this particular Invoice in Invoice Table.

3. Proceed to save current record, Refresh Main Form to be ready for a new data entry.

4.If Answer is "No", discard all current entries in the Main Form, Refresh to be ready for a new data entry.

Sample DB is attached...

View 1 Replies View Related

General :: Button On Form To Print Current Record - Open Preview Before Printing?

Sep 11, 2013

I have a button on a FORM to print the current record with the following code:

DoCmd.RunCommand acCmdSelectRecord
DoCmd.PrintOut acSelection

But what I need is that before printing, open the preview to set the margins and page size ... or at least to pre-configure so that when you press the button, and comes preformatted.

View 2 Replies View Related

General :: Command Button To Insert Records From One Table To Another

Aug 11, 2013

I have two tables, one is GENETIC and the other one is BoneSampleDNAprofile. Both tables have the field CY-Code. I want to create small form with 2 text box fields and one command button on the form to be able to insert CY-Code from the table GENETIC to designated DNA_LAB_Code in the table BoneSampleDNAprofile.

In that small form I would type DNA_LAB_Code and CY-Code where after pressing command button will insert CY-Code for the designated DNA_LAB_Code. This is continuous process after our Laboratory receive results from DNA laboratory. I have attached two .png files which are example of two tables.

View 2 Replies View Related

Modules & VBA :: Use Button To Record Combo Box PK To Table

Jun 11, 2015

I have three cascading combo boxes. How can I program a button to record the PK's from these combos into a table, but only if those values don't already exist.The 3 combos are circled in red and I want to record those values into tblJewelryInventory (circled in dark blue).

View 14 Replies View Related

Modules & VBA :: Delete Table Record - Command Button?

Jun 27, 2013

I have created a form and need to be able to delete employees from a table. I built a command button using the wizard and this is the current vb code-

Code:
Private Sub cmdDeleteEmployee_Click()
On Error GoTo Err_cmdDeleteEmployee_Click

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
Exit_cmdDeleteEmployee_Click:
Exit Sub
Err_cmdDeleteEmployee_Click:
MsgBox Err.Description
Resume Exit_cmdDeleteEmployee_Click
End Sub

But when I click on the button I get a message saying it would create duplicate data in the table.

View 13 Replies View Related

General :: Add Record To Table And Provide Field ID Value For New Record

Nov 16, 2014

I have the following script which updates fields in a table.What I am after is a msgbox script to list the ID field value once it is updated.

Code:
Set rec = dbs.OpenRecordset("Select * from Stk_Merge_Delete_Register")

rec.AddNew
rec("StkItemID") = [Forms]![MergeItem]![txtStkFrom]
rec("RackID") = [Forms]![MergeItem]![txtRackFrom]

[code]....

View 3 Replies View Related

Modules & VBA :: New Record Button With Prefilled Number Based On Selection On Another Table

Jan 6, 2015

I'm making a database that so I can log calibration information about equipment every year.I have 2 tables:

The Equipment details table
The Calibration record table

ID Number is shared between the 2 tables so a calibration record can be linked to its' details.

For Example (simplified sample data):

Equipment Table
ID Item Unit Type
104 Thermometer DegC PT100

Calibration Table
ID Cal Point 1 Test Equipment Unit Under Test Date
104 20 21 22 06/01/15

What I want is a button on a form that creates a new blank record in my Calibration record table with the ID number already entered based on what record I selected in a combo box linked to my equipment table. I really don't know where to start.

View 2 Replies View Related

Queries :: Press A Button And Run A Macro / Append Query To Add A Single Summary Record To Another Table

Aug 2, 2013

I have a query run that gives me a list of records that I view on a continuos form. What I want is to press a button and run a macro/Append Query to add a Single Summary record to another table.

For example my query spits out this data

Part # Quantity Serial Number
GO2 1 123
GO2 2 456
GO2 2 789

What I'm looking to get is

Part Number Total Quantity Serial Number 1 Serial Number 2 ..
GO2 5 123 456

I'm stuck on a couple of things.

1. Getting a new single row to append.
2. Getting Serial Numbers from several records to save on to a single record.

View 4 Replies View Related

General :: Select A Record From Table

Jun 6, 2013

I am trying to run a sql statement in vba in which it selects all the records in a table related to a order Id number. I then want it loop through all the records and check for a check box which is selected. if its selected then "A" variable becomes "1" and i will then run a if statement saying if variable is 1 then run this code else run code b.

The problem I am having is that if there are 4 records the code checks through all of the 4 records and keeps changing the variable so

record 1 variable is 0
record 2 var is 0
" " " 1
" " " is 0

so although the records for a given order number does have a checked box the code wont recognise that.

What I can do or what code I can add my minds gone all blank on this.

View 2 Replies View Related

General :: Unable To Add New Record To Table

Apr 28, 2015

I have been using my db for 3 years without this particular problem: I am now unable to add records to one of my tables - either through the form or in datasheet view. I have a patient table and a visit table. I put in the patient data using a form and then go to the visit form to add all of the visits for the month. I have never had a problem adding data to any of my tables but now I am unable to add data to the visit table. As much as I didn't want to I brought up last month's back up to enter the patients again. Before I did I checked to see if I could add visits - I could not. So I checked January's back up - same issue. I made no changes to the db before trying to add a visit .

View 10 Replies View Related

General :: Update Record ID To Another Record ID In Same Table And Update Related Records

Aug 22, 2013

I have a table called tblCompanies. When a company acquires another company, I need a method by which the acquired company's CompanyID (PK) can be updated to the new company's CompanyID (PK). I also need to be able to update all related CompanyIDs (FKs) to the new value in related tables.

In cases in which the new company does not have an existing record, there is no problem: the company name simply gets changed to the new company and the existing CompanyID is maintained. I then use an audit table and Track Changes function to keep track of the company name data and a union query to keep the old names in the selection lists.

The problem is when both companies already have existing records in the table.

So, let's say I have records for Company A and Company B. Company A merges with Company B and Company B is now the main record. What is the best, simplest and easiest way to update the CompanyID (PK) from A to B and change the CompanyID (FK) to the new value in all related tables?

I am envisioning a pop-up form that directs the user to select the new company and then an update query happens behind the scenes... but exactly how does the criteria for the update query get selected and how do all the related tables get updated? My vba skills are pretty basic, will I need extensive coding to do something like this?

View 6 Replies View Related

General :: Moving Record From One Table To Another Using Inputbox

Jun 20, 2014

I am trying to get a record from tbl_new_accounts to tbl_closed_accounts, based on the number entered in a input box.

Code:
Dim StoreNumber As String
StoreNumber = InputBox("Please Enter The Store Number", "")
CurrentDb.Execute ("INSERT INTO Tbl_Closed_Accounts SELECT Tbl_New_Accounts.* From Tbl_New_Accounts WHERE (((Tbl_New_Accounts.Fld_Store_Number)=" & StoreNumber & "));")

View 1 Replies View Related

General :: Adding New Record To A Table By Using A Mask

Aug 23, 2014

I need to add only one record into a database by using a mask.

For sure when I call this mask via a button, this new record has to be added after the last one.

Someone is suggesting me to use function docmd.openform, but I really dont' know how to do it.

View 3 Replies View Related

General :: Adding New Preset Record Into Second Table

Feb 26, 2013

I was trying to further my knowledge of access. I have a database that is suppose to be used a s a simple budget database.

Form: StartingAmount
Table: StartinAmount
Field: StartingAmount
Button: Create

Form: Transactions
Table: Transactions
Field:
TransactionDate
TransactionName
TransactionAmount

When the database is open the form StartingAmount is open (only until a starting balance is entered.)

User then puts the starting amount in. clicks create.

Then a record is added to Transactions.
TransactionDate = Date entered (auto populate)
TransactionName = Starting Balance
TransactionAmount = StartingAmount

I tried this code:

DoCmd.RunSQL "INSERT INTO Transactions (TransactionAmount) " _
& "VALUES(" _
& "'" & Me!StartingAmount& "') "

With this it kept giving me an Append error and Im not sure how to get it to stop and how to add all the fields needed.

I tired to do:

Code:
INSERT INTO Transactions([TransactionName], [TransactionAmount])
VALUES ("Starting Amount", Me.StartingAmount)

But i keep getting an expected error in the VBA side.

View 3 Replies View Related

General :: Adding A New Record To Linked Table

Aug 5, 2014

I have several tables that are linked that I need to be able to add to. This is an example of the structure:

Patient Info
ID
FK_Ward - ID of Ward table
FK_Room - ID of Room table
FK_Cond - ID of Condition table

Ward
ID
WardID

Room
ID
RoomNumber

Condition
ID
Description

Unfortunately, its not the exact one as I can't post that here! What I am trying to do is to add a new patient record using information from the other tables as guides - e.g. the user selects the name of the Ward but the ID in the Ward table is entered, the User selects the number of the room but again the ID in the Room table is entered, and for the Condition same thing. So I would like to have dropdowns (or ComboBoxes) for each of these and based on the user's selections add a new record to PatientInfo using the ID values as links.

View 4 Replies View Related

General :: Exporting Every Single Record From Table To PDF?

Oct 13, 2014

I need to export/print every single record from table as a pdf file (one record one pdf file). how to do this.

I'm working on Access 2000.

View 1 Replies View Related

General :: Move A Record To Another Table Automatically

Sep 18, 2012

Using access 2003, i would like to add a button to a form so that when clicked all the data in that record is moved (cut and paste) to another identical table, like archive.

View 5 Replies View Related

General :: Creating History Record From Another Table Values?

Jan 20, 2014

I have a table that deals with current data (as in member rentals of items). The normalized tables that we have been given include a rental history table. The idea is that, when the member has returned the product a history entry is made in the completed rental table.

I wish to have a button which is clicked to triggers this event. Would I program a macro to do this? In other words, would I create an event that passes those values to the relevant fields in the other table (Name, date issued, return date etc)?

View 9 Replies View Related

General :: Simple Audit By Posting Whole Record To Separate Table?

Jul 30, 2014

I need a simple audit capability

I have a table (Called Master Active List)

I have an empty duplicate of it called History of Master Active List. (Identical fields, with the addition of a distinct ID (primary key)

I have a form where the master can be changed (Called customer details)

When any change is made I want to post the whole record to the history table

1 - Am I correct I no longer need a form based one,(office 2013) and can do one on the data table itself?

I want to capture everything, can this be done with a wildcard, or do I need to go line by line?

The master table has a ton of fields.

View 3 Replies View Related

General :: Export Table / Query - Two Lines Per Record With Different Specs?

Nov 11, 2014

I have two tables that need to be exported on one .txt file.

One table has the header record. And the 2nd table has the detail record.

My issue is as follows:
1. Need to create one .txt file
2. The header record has one set of export specs and the detail record has a different set of export specs.
3. The first line is the header record, and 2nd line is the detail record.

Example below:
H Abraham Armenta January Cake 00123
D Father Saturday 02536 00123

Both tables have a common control number - in this case represented by the 00123. I just cannot figure out how to accomplish this..

View 2 Replies View Related







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