Copy data from one record to a new record on a sub form

I have a form showing patient details with a sub form displaying all 
associated referral details for the patient. One patient can have more than 
one referral and I would like to be able to copy data from some of the fields 
on the current referral when adding a new referral for the same patient. Is 
this possible?
0
Utf
6/20/2007 12:46:02 PM
access.forms 6864 articles. 2 followers. Follow

1 Replies
1274 Views

Similar Articles

[PageSpeed] 7

Thank you for your help

I am fairly new to Access code and I am having some problem following your 
suggestion could you please simplify. Also some of the fields on the referral 
records are selected via a combo box will these fields still copy?


"Klatuu" wrote:

> Yes, it is possible to do that.  There are a number of ways, but one that is 
> fairly straight forward is to use the Tag property of the controls on the 
> form you want to replicate.  I would suggest a command button on your form to 
> copy the record:
> 
> Private Sub cmdCopyRec_Click()
> Dim varCtls As Variant
> Dim lngCtr As Long
> 
> 'Build an array of the controls to copy
>     varCtls = Array("txtPatientID","txtRefNo", "chkNotifed","chkRefDate")
> 
> 'Loop throught the array and put the current value in the Tag
> 
>     With Me
>         For lngCtr = 0 to UBound(varCtls)
>             .Controls(varCtls(lngCtr)).Tag = .Controls(varCtls(lngCtr)).Value
>         Next lngCtr
>         Docmd.GotoRecord ,,,acNewRec
>         For lngCtr = 0 to UBound(varCtls)
>             .Controls(varCtls(lngCtr)).Value = .Controls(varCtls(lngCtr)).Tag
>         Next lngCtr
>     End With
> End Sub
> 
> -- 
> Dave Hargis, Microsoft Access MVP
> 
> 
> "Echospice" wrote:
> 
> > I have a form showing patient details with a sub form displaying all 
> > associated referral details for the patient. One patient can have more than 
> > one referral and I would like to be able to copy data from some of the fields 
> > on the current referral when adding a new referral for the same patient. Is 
> > this possible?
0
Utf
6/20/2007 2:36:02 PM
Reply:

Similar Artilces:

Problem Opening Notebooks on New Server
I have a small office and we all store and use notebooks on our server. We moved all of our data to a new server yesterday, and now when we try to open the notebooks we get a message that says: "OneNote needs a password to sync some of your notebooks", and we are unable to open the notebooks. Interestingly, if we open the notebook through a mapped drive to the location, we get the error. But, if we navigate directly to the notebook through the network, it will open with no error. We are having no other problems with this mapped drive. Thanks! ...

Pivot Table not pulling all fields or data
Hi All........ Without getting too verbose, I have a 900 row by 26 column database I am applying a Pivot Table to. The code seems to run fine, but it is not returning some of the fields, and of course the related data. I have tried reformatting the entire columns I am pulling from but no joy......however, when I reformat an errant cell from General to TEXT, that row comes in........and/or, if I change the value in one of the missing cells, it will bring that row in. The code runs fine, and was mostly derived by recording a macro in XL2k, but the data cannot be trusted becau...

How do I automatiicaly redefinie Source data range for a chart?
I have A Chart Defined by Category (X) values in Collumn B and Y values in Collumn C. Right now Both are defined by rows 4 to 114. I would like to be able to have the chart automatically redefine itself so if I put a value in C115 the chart would automaticaly set Y value range to be C4:C115 eithout having to manually define chart. Is this possible? If so how? I've tried OFFSET bu so far no luck. Hi, If you turn your data cells into a List, or Table in xl2007, the chart will auto expand. The named range approach will work if you set up the names correctly. See here for more info...

Displaying a stored image on a form
I created an OLE Object type field in a table and then I inserted an graphic file (JPG). I then created a form on which I want to display my graphic file. I tried to display the graphic in a bound object control but the contol only displays the file name or an icon on the form. How can I get the actual graphic to display? I can display an image on a form but this is only a link to a graphic file and if I move or delete the original graphic file the database connection is lost. I want the image to be stored in the database so there is no linkage to outside files. Has anyone done th...

Control of exit from a Form opened within a subroutine
A DoCmd.OpenForm statement occurs part way down my Access 2000 subroutine "Prcs". The opened form presents the user with some screen info from which he/she must decide which of the two command buttons "Continue" and "Quit" should be clicked. "Quit" sends execution control elsewhere while "Continue" is designed to continue processing within Prcs. Sub Prcs tested vb code ' Includes evaluation of "strCrit" DoCmd.OpenForm "frmShowinfo", , , strCrit more tested vb code end sub I've not found a way to stop contr...

Exchange data backup
I'm worried emails backup of the small office. Does SBS2008 Exchange server has a direct backup capability of whole mail database? How to backup every night Emails from server to external harddisk? Does Exchange server needs to be stopped before backup? Thanks SBS2008 Takes care of it. http://blogs.technet.com/sbs/archive/2008/11/03/introducing-sbs-2008-backup.aspx look at the comments section Russ -- Russell Grover - SBITS.Biz [SBS-MVP] MCP, MCPS, MCNPS, SBSC Microsoft Certified Small Business Specialist 24hr SBS Remote Support - www.SBITS.Biz Question or Seco...

Data Save error
GP Ver 6.0. Recently I am facing an error with normal users unable to save records, where as the system administrator is able to save the same information. Please advice on this error, what has to be done. I have disabled the windows user ID of the Database owner. Thinking of this made Dynasa as the DBO. Database is having enough free space available. Hi How big is the company database? Is it over 10GB? Regards James "Matthews" <Matthews@discussions.microsoft.com> wrote in message news:3FF3F553-5B18-4D8A-B65E-8A253BF94BB2@microsoft.com... > GP Ver 6.0. Recently I...

New Mailbox
I have our Human Resources person who already has an exchange mailbox associated with her user name. What I want to do is set up a milbox for responses to a job advertisement to be set up. Is the only way to do this is to create a user name in active directory and an associated mailbox. I'm assuming since Exchange 2003 is fully AD integrated you can't create a mailbox without a user name. On Fri, 12 Aug 2005 12:21:03 -0700, "George Schneider" <georgedschneider@news.postalias> wrote: >I have our Human Resources person who already has an exchange mailbox >...

OfficeMac- Transferrd to new Computer Issue
Aloha, So all my other programs transferred just fine but Office for Mac ... I have 3 keys ... the old computer is no longer in use yet when i open word I get an error message that i have exceeded my permitted number of uses which i have not. Can anyone help me??? Mahalo & Aloha, John Yeah, when you transferred the program, you also transferred the licence key. So now you've got the same key in use twice :-) Remove the key and use a different one (or: power down the old computer). To remove the key, start the Remove Office tool. Immediately press the "Option" key, an...

Create New Company option missing
Create New Company is missing from GP Utilities. Anyone know how to get this option back? EggHeadCafe - .NET Developer Portal of Choice http://www.eggheadcafe.com Rick, Make sure you can locate the SQL folder under your Microsoft Dynamics GP installation folder. Best regards, -- MG.- Mariano Gomez, MIS, MCP, PMP Maximum Global Business, LLC http://www.maximumglobalbusiness.com The Dynamics GP Blogster at http://dynamicsgpblogster.blogspot.com "Rich Fisk" wrote: > Create New Company is missing from GP Utilities. Anyone know how to get this option back? > > EggHe...

Popup Form question
How can I set a pop-up form to only take one record? I have a popup form (single form) to take some customer info however when if they tab past the last field all the data disappears. Anyway to prevent this? Thanks in advance D "Dave" <dave@accessdatapros.com> wrote in news:95EBA52D-5DC8-4333-A18F-9A7EA4B65D77@microsoft.com: > How can I set a pop-up form to only take one record? > I have a popup form (single form) to take some customer info > however when if they tab past the last field all the data > disappears. Anyway to prevent this? > > Thanks in ...

Outlook and message rules- can't get one to work?
I have set up message rules to divert mail from my inbox to various sub folders or new folders. I use these:- Check messages when they arrive\ from people or distribution list \ with specific words in the senders address \ with specific words in the subject or body Now the problem is that some of the messages are recieved from people in my address book and when they send a message sometimes their name and address is in the 'from' and other times it is just their name and so the ones with just their name do not get moved across to the folder I want. I have added their name or...

cell range not changing when refreshing linked data- sumproduct fo
The cell range is not updating correctly to reflect the last row in the data sheet that is being refreshed. 5878 is the correct number of rows and 5824 is not. I can find and replace in my formulas to correct the problem, but it does it each time the data is refreshed. Any suggestions as to why? =(SUMPRODUCT((Expense!$B$2:$B$5878=$C$2)*(Expense!$C$2:$C$5878=$C$3)*(Expense!$W$2:$W$5824=$A6)*(Expense!$M$2:$M$5878))) I gave you the INDIRECT option y'day, but received no feedback from you in that thread. Looks like you're more interested in knowing why? One simple hunc...

Data vs. forms & Unload/reload questions
A .mdb file seems to encompass both the database and all the 'code' (forms, modules, and logic) used to CRUD the data in the tables. 1) Is there any way to separate the database from the code into separate files, eg. the db is mydata.mdb and the 'code is in a separate file, eg. code.mdb? 2) Say you have v1.0 of an app and the tables and attributes are populated with data. You then go and build v2.0 of the app, adding tables and columns to what already existed in v1.0, and perhaps moving some of the v1.0 attributes into different tables. What is the recommended way to unload/reloa...

Excel no more new fonts
I'm getting the message "no more new fonts may be applied to this workbook". How can I get around this? Thanks. Tuan, Any chance that you have a lot of charts in the workbook? There's a limit of 256 fonts in a workbook and each chart uses up two of them. Check here for more info. http://support.microsoft.com/default.aspx?scid=kb;en-ca;168650 John "Tuan Ma" <tma@conocophillips.com> wrote in message news:0e5201c365f4$c036d370$a001280a@phx.gbl... > I'm getting the message "no more new fonts may be applied > to this workbook". How can...

Can a user's Worlplace be defaulted to a standard one
Hi, Is it possible to set a standard Workplace that users will see based on either their role or team? We have a client who wants to set standard worplaces for respective teams/users. TIA Hi GP, Ian Watson had a good method-- "simply click on Workplace bar, then just above click on "personalize Workplace" then tick on or off what you need" This could also be done through changing the security role to allow certain privaleges. You cant change a system security role, you have to copy it and rename it. Settings | Security Roles | highlight the role you want to copy | ...

Data Format: how can I re-format
The spreadsheet that was exported for me to use has the information in paragraph form: It is customer ID name and billing info but it is like a long series of address labels. I want to be able to have them listed under captions like company name, contact, address, city, etc.. so I can use the data. There is an empty row between each entry. Each entry is 3 or 4 rows. There are about 500 records so i dont want to manually set them up. Thanks Try tinkering around with these steps Assuming your list is in col A, data in A2 down (If data starts in A1 down, insert a new row for the co...

Form Locked !
Hi, I created a form using the wizard based on a query, everything looks ok but i cannot enter data into the form as it appears to be locked ? what have i done wrong, i been trying to solve this for 2 hours now - please can you HELP!!! blake7, One common reason is the query used for the form. Open the query and see if you can add a new record to the query. If you can't, have a look here: http://www.allenbrowne.com/ser-61.html Jeanette Cunningham "blake7" <blake7@discussions.microsoft.com> wrote in message news:808F403F-8822-4619-9F50-DCA5E8B57DC1@microsoft.com... ...

How to 1. Jump to a specific page (in a massive document) based on a search then 2. Copy and paste an string of characters a few lines above it.
BACKGROUND/CONTEXT I am working from a very large word document, approximately 1000 pages long. Each page has one 'article' on it. I am currently doing something manually, which I would love to do using a macro. I am populating a table (which happens to be in an Excel spreadsheet) One column is the Article number 'xxxxx'. One of the other columns is a 'Topic' which is typically three alphanumeric characters (like AA1, AD4, BB4 DO6 etc.) PROBLEM/TASK This is what i have to do Step 1 - Jump to the page with the article number. Achieved by p...

Display comments as data #2
thanks a lot , this worked exactly as required, the comment go converted to data Now just one more thing . is the vice versa possible i.e if i have dat in column A can it be shown as comment in column B. the reason i need this is bcos i am shifting some data with thei comments to MS access(Hence the need to convert omments to data) processing them and again converting them to excel (the need to conver data back to comments -- sonik ----------------------------------------------------------------------- sonika's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=...

Count invalid data entries
I am using the following macro to identify invalid data entries in cells with data validation applied. Sub CheckOrder() ' Application.CommandBars("Formula Auditing").Visible = True ActiveSheet.CircleInvalid Sheets("Configuration").CircleInvalid Sheets("Parts_TakeOff").CircleInvalid MsgBox ("Check for Red Circled Invalid Data Entries on" & Chr(10) & " Configuration and Parts_TakeOff Sheets") End Sub Is there a way to count the number of invalid data entries (red circles) and write the number to a particular ce...

Default form in Public Calendar folder
I have a calendar in the public folders. Is there any way so that when the user clicks on the "New" button in Outlook that the default form that opens is a "Meeting Request" as opposed to an appointment? Thanks! Sylvia <sylvia@nospam.com> wrote: > I have a calendar in the public folders. Is there any way so that > when the user clicks on the "New" button in Outlook that the default > form that opens is a "Meeting Request" as opposed to an appointment? I don't think so, but you can certainly click the down-arrow next to the New ...

Copying Formula Text
Is it possible to copy and paste just the text of a formula from on cell to another without going into the formula text window and usin Ctrl+c. Can this be done from multiple cells to multple cells. thanks -- jp ----------------------------------------------------------------------- jpx's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=101 View this thread: http://www.excelforum.com/showthread.php?threadid=37716 edit/copy select new location edit/paste special, select Values. OR... Right-click the BORDER of the selection and drag to the new location. When you ...

Unwanted Code Being Added to Form
This is a multi-part message in MIME format. ------=_NextPart_000_0085_01CAB57D.00862050 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Access 2007 sp2. I thought I seen it all. For some reason code was added to the OnClose of one of my forms that I = DID NOT put there! The code is a 1 liner using the NavigateTo command.(irrelevant I = believe). I recall testing using custom Navigation Panes about a year ago but = abandoned it. I recall having code in the OnClose of my form(s) that switched to a different Custom = Nav Pan...

Multiple combo boxes on a form
I have a form based on two tables. I would like a combo box for a field from each table that will fill in various fields from the relevant table. Does anyone have any suggestions? On Fri, 17 Aug 2007 23:58:37 GMT, "Malt" <u36720@uwe> wrote: >I have a form based on two tables. I would like a combo box for a field from >each table that will fill in various fields from the relevant table. Does >anyone have any suggestions? Why would you want to do that? It sounds like you're trying to store data from one table redundantly into a second table. This is essentially ...