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
1305 Views

Similar Articles

[PageSpeed] 54

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:

error in importing data
Sorry the error is 0x8004032d ...

Re: Extracting Exchange User Data From AD 02-24-10
If you do not like scripting, you can try GAL Exporter or Fast User Manager & Reports from IMIBO - http://www.imibo.com > > "Ringholz, Blake" <bringholz@nospam.com> wrote in message > news:76AEFC2F-85A7-4666-8262-27FB0737D09A@microsoft.com... >> Hello All - >> >> I need to get an Excel Spreadsheet that lists everyone first name, last >> name, email address, job title, etc pulled from Active Directory. Is >> there an easy way to do this? >> >> Thanks, >> Blake > > > > > ...

Add a specific Record to a Table based on a check box
I have a Table called ServiceTypes. Based on a User's input on a ProposalForm, ServiceTypes need to be added to a ProposalServicesTable. For instance, I have a Check Box on the ProposalForm. When a Check Box is clicked Yes, Access must search the ServiceTypes Table, select a specific ServiceTypeID, and add the ServiceType to the ProposalServicesTable. How can I add the proper Service record from the ServiceTable to the ProposalServicesTable based on the Check Box? I wouldn't do it that way. I'd use a listbox (with multi-select set to YES) that was sourced to the ServiceTab...

Can I delete my switchboard and make a new one?
I do not like my switchboard and would like to delete this one and start all over. But when I did delete it I couldn't make another one, because I couldn't delete the default. What should I do?Thanks,Dustin Just delete the form and the table that were created by the wizard, then start over.-- Rick B"Dustin" <Dustin@discussions.microsoft.com> wrote in message news:42F94A44-9352-4D02-9104-65593869B271@microsoft.com...>I do not like my switchboard and would like to delete this one and start >all> over. But when I did delete it I couldn't make another one, beca...

Using different form strings to filter
Hello. Is there a way to code a query to have it use a filter string if a form is open, or ignore it if the filter is not open? Example: Query Name: Query1 Form: Form1 and Form2 Query fields: Field1 and Field2 I have a string in field 1 and 2 Forms!Form1!Field1 in the first field of the query, and Forms!Form1! Field2 in the second field. Can I also have Forms!Form2!Field1 in the query as well? I have tried this, but a box pops up and asks for the information from form 2 when it is not open. Thank you. hi, nybaseball22@gmail.com wrote: > Hello. Is there a way to code a query to...

Doing Analysis from large amounts of DATA
Hi all, I have an attachment that's apart of this message & within it I have 3 tabs 1) Revenue 2) Expenses & 3) Net Position. I would like to do some Analysis on the above three thou a way where I can manipulate the Data. How would I go about doing this? I've tried a Pivot Table thou it didn�t work out in the sense that it was messy & just failed in calculating stuff, not sure if I did it right thou.. Would really appreciate all the help as I actually have about 20 of these sheets which from that fall into 4 groups being 5 sheets per group. I hope this all makes sense, wo...

lost data when opening excel workbooks ; text import wizard popup
When opening many of my excel files ,which all have the same modification date, I come across the text import wizard which states that my text in these files is 'delimited'. All of the files ,including a few word doc.s have had their data changed to show all " y " with two dots above the letter for as far as the eye can see. No import or export has been done with the files and no modifications were done on that date, as far as I know. Is this a corruption problem or is their some 'fix' that I am overlooking. Thanks for any ideas. ...

about new operator
hi group here is my second problem i am allocating a buffer char *p = new char[1024]; p = regBuffer.GetBuffer(regBuffer.GetLength()); and after doing all the work i am trying to free that memory with 1)delete []p; p=NULL; 2)delete p; p=NULL; but in both the cases i get error as debug assertion failed File dbgheap.c Line: 1011 Expression: _CrtIsValidHeapPointer(pUserData) can anybody tell me what's wrong with this code harshalshete@gmail.com wrote: > hi group here is my second problem > > i am allocating a buffer > > char *p = new char[1024]; > > p = re...

Convert Column to row with variable data
Hi I'm using Excel 2k and I have a spreadsheet that looks like this Name Address Fred 21 Blah St London Sue Tower 50 London EC2 and need it to look like this Name Address 1 Address2 Address3 Fred 21 Blah St London Sue Tower 50 London EC2 I have a macro that can convert from column to row but only for a set number of columns. Is there any way to account for the variable amount of data for each address ? Any help much appreciated Thanks David David: I suggest the following formulae - copied down as necessary: C2: =IF(...

New mail appearing as old deleted item
When new mail arrives in inbox an old long deleted item appears in place of the new mail showing in bold as new mail. The real new mail is not visible at all and is therefore lost. This problem also used to happen in Windows Mail so I bought Outlook 2007 but it still happens intermittantly. -- Kate What do you see in your Unread Mail folder? "Kate B" <KateB@discussions.microsoft.com> wrote in message news:D9A95DD7-CFC4-423F-9B2B-F8B72177E2CE@microsoft.com... > When new mail arrives in inbox an old long deleted item appears in place of > the new mail...

Excel 2002
Have several spreadsheet files I use routinely. Three have recently crashed after I added another sheet. In each case the document recovery created a file missing all the color and text formats that the file contained before the crash. Not sure what other changes may have occurred. Is there something wrong with the copy of Excel on my PC? Could these three files be corrupt? Is there a procedure to "clean-up" these files? Thanks in advance for any suggestions. Mark Hi sounds like they are corrupted. I would suggest to copy the data + formats to a new, 'fresh' workbook. ...

Do you need Access to use an Access Database for data entry only?
We have an Access database completed. Now we will use it for reading as well as for data entry. Do we need to install Access for every workstation needing the database for data entry or reading? No you don't necessarily need Access on every computer. You CAN use the Access Runtime and if it is in Access 2007 you can use it for free. If you are using another version then you would need to purchase the developer's edition to be able to legally distribute the associated Access runtime. If you do have 2007 and want to use the runtime, make sure your Full version of Access doe...

Access, average several fields in one row
I have several rows of data in a field, I need to average all the entries in one row I have 12 fields for 12 months of data, I need the average of the sum of all non blank entries. For example 3 months completed, the solution in Excel is (field1+field2+field3)/3 I am looking for method to average the sum in Access One way if you can't change your data is to use a VBA function. I've posted one below. You would call it in a calculated field in a query. Assuming your field names are the abbreviated month names the expression might look like the following. Field: fRow...

Connection filtering record
1. I have set up connection filtering. How can I see what mail is being rejected? 2. Since setting up connection filtering the email tracking shows all emails being delivered to the intended recipient AND the badmail folder. Could someone explain this? To answer your first question, take a look here: http://www.martijnjongen.com/eng/html/log_analyzer.htm Not sure about the second question. -- Mark Fugatt Exchange MVP http://www.exchangetrainer.com http://www.msexchange.org "Nate" <nmorse@aimcomm.com> wrote in message news:ewUBm6C3DHA.2056@TK2MSFTNGP10.phx.gbl... > ...

Deleting record from bindingsource
Hi I have a winform app with form control bound to a binding source TblClientsBindingSource. The binding source has a data table as its data source as per below code; dAdapter = New OleDbDataAdapter("SELECT * FROM tblClients WHERE ...", Conn) dAdapter.Fill(dTable) TblClientsBindingSource.DataSource = dTable My question is; how do I delete the record currently pointed to by the binding source from the backend database table tblClients? Thanks Regards John wrote: > Hi > > I have a winform app with form control bound to a binding source &g...

Importing data into Outlook #2
Is there a process or program with which I can transfer my ACT! data into Outlook contacts? Thanks! ...

Sub Folders
Hi Is there a way to check if a folder has a sub folder and if yes get its name, also to loop until no sub folder is found. C:\Weeks Post\Sundays Post\Mondays Post\Tuesdays Post etc. Create Post array Post(0) = Sundays Post Post(1) = Mondays Post Post(2) = Tuesdays Post something like this, can you help? regards Ron On 24/11/2009 09:52, LondonLad wrote: > Hi > Is there a way to check if a folder has a sub folder and if yes get its name, > also to loop until no sub folder is found. > > C:\Weeks Post\Sundays Post\Mondays Post\Tuesdays Post etc. > ...

MapQuest Buitton on Form
Arvin: Hope you see this post. Mapquest must have changed their code. My Mapquest button on the form does not work anymore. The reason is that in Canadian Postal Codes there is a space (ie. E3A 3N7). My data is stored this way. Mapquest used to accept this format but not anymore. How do I delete the space in the hyperlink created from the event on click (button on Form). Your help would be greatly appreciated again. Here is my code. Private Sub cmdHyperlink_Click() Dim strPath As String If Not IsNull(Me.Postal_Code) Then strPath = "http://www.mapquest.com/maps/" &a...

Forcing Input as Uppercase on User Form
Hi can any one advise me how to amend the following code to ensure :- (a) only two letters are input (b) they are converted to upper case (c) how do you centre the text in a message box header as I have use spaces to achieve this Code used inputVal = TextBox1 Do Until ActiveCell = inputVal ActiveCell.Offset(1, 0).Select If ActiveCell = "" Then MsgBox ("Sorry Not Found - Please Input the first two letter only e.g. RG ") ", vbInformation, " Warning !! " Unload UserForm1 UserForm1.Show End Else End If Loop Excel v...

Close a form when it loses focus
Hello All Is it possible to make a form close as soon as the user clicks elsewhere on the screen? The form in question is a trivial popup form that is best shown in datasheet view, so I can't add a button. I know the user could close it with the 'X' in the top-right corner, but for other reasons it would be much better if I could force it to close as soon as they click elsewhere. I have tried adding the following OnLostFocus event to the form, but nothing happened! DoCmd.Close acForm, "[frm contacts]", acSaveYes Second question (or does this need to be in a...

Outlook 2007: When i Save a New Rule outlook Change it automatically...
Hi people! I have this problem with Outlook 2007. I have 15 e-mails addresses in my outlook, but i can=B4t create the rules for send all the received mails to each emails folder. Example: I want to create a simple rule that move all the e-mail that i get from "example1@example1.com" to the folder "Inbox/ example1@example1.com". When i create the rule, all works fine, i select the correct e-mail account name, the correct destination folder, etc... but when I hit the SAVE button in rules window, Outlook 2007 changes the account automatically to another one. Not automatically...

How do I show a data table with legend keys in a line chart?
I am having trouble inserting a data table with legend keys into a line chart that contains a horizontal target line. Can anyone help me? Hi, I tried it in both 2007 and 2003 and had no problems. We need more infomation, can you post a sample of the chart somewhere. The only issue I have is that the target line is displayed on the data table, which I would prefer that it not be. -- Thanks, Shane Devenshire "excelbanker" wrote: > I am having trouble inserting a data table with legend keys into a line chart > that contains a horizontal target line. Can anyone he...

Subform doesn't work once added to main form
Hi, I've been searching around looking for some help and can't find anyone that has had quite the same problem. I have a main form called 'Sites' and have added a subform called 'Previous Year Flows' into the main form. I do not enter data into this subform. Instead, data on previous years is drawn through from a table called prev yr flows into this subform. When I open the subform on its own it draws through all the necessary data, but when it is embedded within the main form, none of the actual data is pulled through at all, although the linked fields, Site ID and A...

Form with desktop shortcut
I created a form which displays one record. The record is chosen at random by a query. It works fine within Access 2003. However, when I create a shortcut to the form on my desktop and run it that way, it always gives me the same record. How can I get the random record I'm looking for? -- CindyLuWho Cindy, I'd say you're probably better off creating a macro that opens the form at the required record. Your desktop shortcut should call this macro, rather than the form. Regards, Graham R Seach Microsoft Access MVP Sydney, Australia "CindyLu" <CindyLu@discus...

Output the list of frequent data
Dear all, Here comes two problems. Problem 1: I have a list of strings (say, in the column A1:A100). How can I find the "mode" (i.e. the string appearing most frequently in the list? For example, if the list is APPLE APPLE BANANA APPLE CREAM CREAM BANANA CREAM APPLE DONUT then I want the result is APPLE. It seems that the MODE function does not suppot data type other than numbers. Is there any canned UDF for it? Problem 2: Following Problem 1, I want to generate a list of the 3 most frequent data in the list. If the list is the one in the example, I want to list to be...