Copy Contents Of Fields To Other Fields, With Macro?

Nov 30, 2004

Hi,

I hava a small dbase in which we store address information. Now you have a visit address, a mailing address and billing adress.

I want to use some buttons which trigger macro's to fill in these "Secondairy" addresses FROM the visit adress.

So a buttun that says: copy billing address from visit address. and then the street, Number, PO box en city will be copied from the visit address to the billing address.

It's probably possible through a macro but I'm having a hard time coming up with the syntax. Or it there an easier way? :confused:

I hope you guys can help me out. THANKS!!

View Replies


ADVERTISEMENT

Copy Button In A Form To Copy Fields To Other Fields In The Same Record

Sep 23, 2005

Hi there,

Can someone help me on this issue?

I want to copy Postal Address Information to Visit Address Information wthin the same record, in my Contact Database that I am building at the moment.

I want to copy 4 fields to 4 other fields within the same Record.

This the current code I use for the Copy-button:

---

Private Sub cmdCopyFields_Click()

Dim v1 As Variant
Dim v2 As Variant
Dim v3 As Variant
Dim v4 As Variant


v1 = Me!Field_a.Value
v2 = Me!Field_b.Value
v3 = Me!Field_c.Value
v4 = Me!Field_d.Value


RunCommand acCmdRecordsGoToNew

Me!Field_e = v1
Me!Field_f = v2
Me!Field_g = v3
Me!Field_h = v4


End Sub


---

The underlined part (acCmdRecordsGoToNew) is false part of this code, because it copies the Adress Info to a new record, instead of copying it in the same.

-Is there someone that can help me with this problem, to make the copy-button in the Form run properly?

-Are there other options to achieve te same?

I have put in a attachment, to give you guys a visual example of what I mean.



Thanks in advance,

Quinten

View 3 Replies View Related

Forms :: Copy Specific Fields From Selected Record To Specific Fields In Subform?

Jul 9, 2015

I am new to access i have a problem which is i have made a form which contains a subform and a read only subreport, what i want is the ability to select a record in read only subreport as in the picture attached and make a button that when i press on it, it should copy the values of the itemsID field, Packing field, ContainerNo field and origin field from the selected record and then paste them in the subform below.

Also i want to add more then one item, so the when i press on another record it should paste the values below the first record.

View 12 Replies View Related

Check Contents Of Subform Fields

Mar 24, 2006

I have a repair database which I'm working on. On the main WIP form there is a subform stating the faults which have been logged against that unit. The unit can be scrapped at any time by hitting the SCRAP button, but if the unit has had it's faults successfully repaired, then it can then be FINALISED which means it can be shipped to the customer.

I need to be able to check the records in the subform, to look for faults which have not been repaired. When they are repaired, the text "PASS" will be present in the TEST_RESULT field. I want to be able to check the TEST_RESULT field for each fault to ensure they are all a PASS before I allow the unit to be FINALISED. Any ideas how I can do this? Or am I taking the wrong approach?

Thanks,
Gareth

View 10 Replies View Related

How To Update A Field With Contents Of Two Other Fields

Jul 3, 2012

I'm an excel user and in using excel I can take two fields and combine their data in one field. I've got about 6 database files with anywhere form 1000 to 3000 records that have already been prepared and imported into access database files .mdb and I realize that the firstname lastname fields need to also be combined into a contact field with both names. In Excel it's easy in access I'm a little lost. I was looking to an update query however I can't find instructions on what I'm trying to do.

View 2 Replies View Related

Listbox To Show Contents Of More Than One Fields In Another Table

Jun 23, 2005

I have a field called "Bad Pc Part" which is a listbox. THe problem is I want it to display the contents of 3 other fields from another table.

I created a query for the Bad Pc Part field but the problem is it only displays the information in the first field of the table. It doesnt show the contents of the other columns. I need it to do this.

Please Advise3.

View 1 Replies View Related

Hide Fields On A Form Dependant On Contents Of Txt Box?

May 16, 2005

Hi,

How can I get access to hide certain fields or controls on a form if a certain field has no data?

Allow me to explain further:

I have a form that displays data = frmPlantMain
and a associated image = Image1
The image is stored outside of the db as a jpeg and the field in the record source table (Image1) contains a link to the image. For example: C:databasePicture1.jpg

There is also a hidden text box that contains the message "No Image available" = lbl_NoPix
This would be displayed in place of the image if no image has been inserted.

I also have a seperate "insert new image" command button = cmdInsertPic

If the current record has a image then I want to have the controls Image1,lbl_NoPix & cmdInsertPic hidden. This seems fairly easy but it gets more complicated now.

If there is no image I would like these controls visable so that the user can add a new image. I would then need the record to be requiried or refreshed to reflect the fact that a new image has been added.

This is where I fall down - I do not know how to tell access to look at the field in the table (Image1) and if there is no linked or associated image then set the visable propertys of controls a,b & c on the form to true.

I hope I have explained my problem correctly and I thank you for your time in advance.

Regards,

Kenny

View 5 Replies View Related

How To Use Where Condition In Macro Access 2010 For Two Fields

Feb 25, 2013

I need to make a filter by using Macro in Access 2010..So in "Where Condition" I should put an expression belong to the poth of the fields. I now how to use "Where condition" but only for one field like below :

Code:
="[TabReq_No]=" & [Text2]

View 7 Replies View Related

Copy Fields To Another Table

Nov 12, 2014

What I need to do is copy some fields from one table to another after updating via a pop up form.

Explanation:

Form [frmWorkItem subform] and [frmReactiveWorkPoList] are located on a tab control (Tab110, pages 0 and page1) and are linked by [ClientID] to the main form [frmReactiveTracker]. The functionig of this set up works fine.

The process of entering data starts with [frmWorkItem subform], here i use a popup form to enter a new record and when the popup closes the new record is seen in [frmWorkItem subform]. Unfortunately there are five duplicate fields in table frmReactiveWorkPoList which can't be changed now (the result of bad normalisation and now too much work to change it).

The duplicated fields in the newly entered record in [frmWorkItem subform] need to be copied to the respective fields in frmReactiveWorkPoList either when the popup closes or some other more efficient method.

I have attached the sample stripped down database. To start open frmReactiveTracker and pick the third name from the drop down list.

View 11 Replies View Related

Copy Values To Multiple Fields

Jun 20, 2006

Hello,

I am running a database in which end users input values into a table via a data access page. The problem is that there are usually lots of records in this table which requires the same value for a particular field.

I was wondering if there is a way to implement something so that the user can input the value once and the value is then copied to all the records?

Many thanks in advance

View 1 Replies View Related

How Do I Copy The Design & Fields Of A Form?

Sep 11, 2005

I have a table and a form that I designed. Now I need to copy all the fields and the design of the form I just created and give it another name so my partner can use the same design and fields, but put in his own information. Is it possible to copy just the design and the fields. If so, how do I do that? Thanks.

View 7 Replies View Related

Copy Text Fields On Form

Jan 28, 2006

Hi

I new to VBA and having a few problems with a database I'm working on.

I have a form that contains customer details. The are two sections one for the Registered Office Address and one for the Trading Office Address. I want to be able to allow the user to auto fill the Trading Office Address fields if the Trading Office is the same as the Registered Office.

I'm not sure how the event code should look. I was just going to add a button that will copy the text from the Registered Office Address fields and add them to the Trading Office Address fields. I've tried a couple of other groups but the replies just contain use this code....

TOName = ROName
TOAddress = ROAddress
etc... for all your fields.

I need a little bit more info on how the event code should look.

Any suggestions on the best code to use would be greatly appreciated.


Kind Regards

David

View 3 Replies View Related

Copy Existing Fields To New Records

Dec 12, 2006

I have a database and I wish to be able to copy 10 out of about 20 fields into a new record automatically using a command button on a form. Similar to the way the Duplicate button or the Create New button would work but only with these selected fields. None of the fields I wish to duplicate are the primary key. The primary key is an AutoNumber field. After clicking the Save button, the primary key would increment one to confirm the save record.

Any help or suggestion would be appreciated!

Thanks!

View 3 Replies View Related

Forms :: How To Copy Fields From 1 Record To The Next

Aug 6, 2013

I have fields on a form for the Date, the Start time and the Finish time. These won't change for the next 120 records. So, upon opening a new record, I'd like the Date and times to appear there already. But here is the crux: After about 120 entries, the date and Time changes, for the next 120 entries. So, once the 'batch' is finished, or I close access, the values do not need to be remembered until I enter a new record.

I copied something like the following from a book and tried running it with various modifications, just for the Date to start with, but no luck. (It did strike me as too simple for something, clearly, as unbelievably TRICKY as my problem...) I did find quite a few posts on this here but none seemed to work for me, or made sense to me in the slightest. (I did mention that I'm a complete rookie, didn't I?)

Private Sub Acquired_date_AfterUpdate()
Me!Acquired_date.DefaultValue = "'" & Me!Acquired_date.Value & "'"
End Sub

View 7 Replies View Related

Modules & VBA :: Bring Up Msgbox If Certain Fields Blank And Not Run The Macro In Form

Jan 20, 2015

I have a form with various text, date and combo controls. There is a button at the button that runs a macro (Close NB) at the bottom. What I'm trying to do is bring up a msgbox if certain fields are blank and not run the macro. I only want the macro to run if all the fields specified have data in them.

The fields are :
cmb_cliname
cmb_disease
cmb_projectType
cmb_ProposalStatus

The on click code is:
If (Me.cmb_cliname Is Null) Then
MsgBox "Please fill in the relevant details",
ElseIf (Me.cmb_Disease Is Null) Then
MsgBox "Please fill in the relevant details"

[Code] .....

View 6 Replies View Related

General :: Macro To Create Table Fields From Another Tables Records

Jul 10, 2012

I think what I want is:

1 table(1): record of people & contact details
1 table(2): list of events with check box's with the names of people from the other table
1 report: listing how many events people have attended.

When I add a new person to table 1 I want a field to be added to table 2 in the form of a checkbox, also when I delete this person I want this field to be deleted in table 2.how to make this an automated process.

View 1 Replies View Related

Forms :: Macro To Apply Filter - Search Multiple Fields

May 9, 2013

I'm trying to implement a macro to filter through accidents to see if my company has already been hired on a particular case.

In the first form the user enters the date, location, and last name of one of the drivers. Then they click a button which opens a new form as a datasheet with accidents that match ANY of the three controls. Evidently, I need a filter that contains some form of a series of OR operators.

However, whenever I try any variation of a button that opens the second form and then applies the filter, I always get no matches.

View 12 Replies View Related

Forms :: Command Button To Copy Certain Fields?

Apr 10, 2013

I currently have a form for a handover process and am looking to have a button to ideally take a section of inputted information from the form and place this into an email.

IncidentReferenceNumberName1
DescriptionSignificant1
ActionTakenSignificant1
CurrentStatusSignificant1
TimeLoggedSignificant1
TimeResolvedSignificant1
NumberofcallsreceivedSignificant1

Are my fields, this goes up to 4.

I want to copy all these fields from my form, ideally into a new email but if not possible then atleast just to clipboard, is there any way to do this?

View 7 Replies View Related

Modules & VBA :: Copy Between Unbound And Bound Fields

Apr 21, 2015

I have 2 fields in an MS Access form "BTKForm" sending and picking up data form a bank terminal.

Code is executed by clicking a Button on the form.

Field 1, "IssuerID", is an Unbound field picking up a code from the bank terminal. It's numbers between 0 and 100, representing the Card provider.

Field 2 - "IsID", is a value field linked to a table.

I want to take care of (save) (copy) "IssuerID" in to "IsID".

Code:

Public Sub TransferAmount_Click()
Set BAX = CreateObject("BankAxeptSrv.BankAxeptAutomation")
If BAX.Connected And BAX.LicenseVerified And Not BAX.BankMode Then
Dim amnt As Long
Dim cashb As Long
amnt = Round(Amount.Value * 100)

[Code] .....

View 12 Replies View Related

Forms :: Copy Fields To Multiple Records?

Jul 17, 2015

I have this access "Database" that contains only one table that I'm trying to make a form for. I want it to allow the user to enter a value for field A and a value for field B then a list of values for field C (which is the key, so each would be a new record all with the same values for field A and field B). I tried to make a multiple item form but when I click on the new row for field C, fields A and B both disappear.

Disclaimer: I know that the creation of a one table database is a mortal sin but that's what my boss gave me and there are already >8000 records with a million mispelled words, so I don't think there's much I can do to make it a relational database without entering each record in again.

View 4 Replies View Related

Forms :: Copy Certain Fields To Another Field In Same Table

Sep 8, 2013

I am using MS Access 2010 and I am trying to figure out how to copy a field(s) to another like record. For example I have simple split-form that contains detail items purchased (product number, item purchased, cost, etc). I have a check box call "chkApproved" and date box called "Approved Date". The user have a choice to select the invoice number, once selected the invoice number (there maybe anywhere from one or 2 to 4 rows based from the same invoice number).

The manager will go to the first record and check the "chkApproved" and date is automatically updated as today's date (Approved Date). This is fine if there is only one row, but when you have the same invoice number with 2 to 4 rows the user has to go to each row and check the box. I want to somehow automatically populate the rest of the rows within the same invoice number I don't need to create a new record only updating the existing records.

View 2 Replies View Related

Forms :: Loop Through Records And Copy One Of Fields For Each Row Into Another Subform

Apr 12, 2013

I have a subform for which I want to loop through all the records and then copy one of the fields for each row into another sub form.

I came up with the bellow code but i get an error when I run it.

The error is an "error 438".

Code is at follows and I am copying the field called price:

Do Until Forms![Roll Out - Site Form]![Roll Out - Sign items pick list].EOF
[Roll Out - Sign items added].Form![Price] = [Roll Out - Sign items pick list].Form![Price]
Forms![Roll Out - Site Form]![Roll Out - Sign items pick list].MoveNext
Loop

View 4 Replies View Related

General :: Find Specific Row And Copy Its Fields To Array

Feb 16, 2014

I'm new to Access but comfortable with Excel and VBA.I'm trying to transform a VBA-heavy form from Excel into an Access database, as multiple accessing is required, as well as data analysis. The situation is I have a form where users enter data (name, account number, date, etc). The account number is unique, and I have a table of approximately 14000 account numbers which contains the company name, address, and other details for each account number. I've set the account number as the primary ID on the accounts table.

What I would dearly love to be able to do is: when the account number is entered on the form, it is searched for (e.g. by the user clicking a button) from the accounts table. If it is located, the 7 fields in the relevant row are displayed in 7 textboxes on the form. I do not want to record the address, just display it on the form so the user can choose whether or not to use it.

So far, I have found GetRows, which seems to be able to convert the fields into a 2D array... this could be usable. But how can I do the first bit - find the correct row in the accounts table based on the account number entered into the textbox on the form? Is it possible to do this behind the scenes? In other words, Access finds the right row and displays each field in its textbox on the form, without producing a report form first.

View 5 Replies View Related

Creating A Table Of Contents / Index / Need Macro To Create A Field

Apr 4, 2014

I have a situation where I have a report which I will generate to print our companies pricebook. I need an index/table of contents for customers to go to the page where a product is to look up prices. The problem is that we add and subtract products on a consistent basis.

So a new product will get added, but of course, to run alphabetically, there's no way to insert it, then renumber the pages for it to be easily found.to use a maketable query, which sorts all of the products alphabetically. Each time it is run, it will delete the previous table. I then need to have an autonumber field created to create my "page numbers". Yes, each time the pricebook is run, products can and will oftentimes get new page numbers.

So my thought is to have a macro run which creates the autonumber field to the table. This will then be the basis for the form, which will in turn utilize the "page number"/autonumber field to both serve as page numbers in the report. And of course, the table which is created each time will be the "table of contents".

View 5 Replies View Related

Modules & VBA :: SQL To Copy Field Contents With Reserved Characters

Jul 11, 2013

I've got some code that loops through a record and copies the non-null fields to another record. This is the partial code:

For Each fld In tdf.Fields
If Not IsNull(Forms!contact_lookup![Contact_sub subform1].Form(fld.NAME)) Then
strSql = "UPDATE tbl1 SET tbl1.[" & fld.NAME & "] = '" & Forms!contact_lookup![Contact_sub subform1].Form(fld.NAME) & "' " & _
"WHERE tbl1.[FC_APN] = '" & Me.txtApn & "';"
DoCmd.RunSQL strSql
End If
Next fld

This works fine until it encounters a field whose contents has a reserved character, like a single quote (" ' ") in it, for example, "What's the what." At that point the SQL thinks there's a " ' " missing in the statement, and I get an error 3075 (syntax error: missing operator).

View 2 Replies View Related

Automatically Copy Data From One Field In A Table To Other Related Fields In Other Tables

Aug 7, 2014

I'm trying to create a system where if I enter data into one field it will automatically appear in the corresponding field in another table. For instance if I enter the values 10,12,15 into a field called QID in table A I would like this to appear automatically in a field called QID in table B. Both tables are related and I have enforced referential integrity and 'cascade' options but this still doesn't seem to allow one table to automatically update another. My ultimate aim would be to have a form that you filled in data for the field QID once that then propagated to both Table A and Table B.

View 2 Replies View Related







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