Temporary Form with 2 Sub form Update Main Form And its Sub form ?

I have 2 table both are exactly same
PatientRecordTransTb And PatientRecordTb 

I know many programmer don’t like TempTb, but in my case I don’t trust some
one to mess 
with my Main record table. So simple solution is make tamp table and after
review I click to transfer all records from temp Table to main Table So I
have two forms . 

PatientRecTransFm record sources = PatientRecordTransTb    
PatientRecordMainFm record source = PatientRecordTb

PatientRecTransFm  has 2 button AddRecord And Delete Record 

Here is a short story of my code (NOT A Actual Code)

mySQLString = "INSERT INTO PatientRecordTb( LastName,FirstName,Status  …ect)”
mySQLString = mySQLString & " SELECT PatientRecordTransTb.LastName,
PatientRecordTransTb.FirstName….
mySQLString = mySQLString & " FROM PatientRecordTransTb;"
MsgBox Yes No 
If Yes:  Then
               DoCmd.RunCommand acCmdSelectRecord
        DoCmd.RunSQL ("UPDATE PatientRecordTransTb SET PatientRecordTransTb.
RecAdded = True;")
        DoCmd.RunSQL (mySQLString)
        Me.Requery
        End If
So far This was working  perfect 

Now I Add 2 Sub Form in PatientRec Main Fm And PatientRecTransFm
I need to know How can I  update these 2 subform record from trans form to
main form ??
Is there is a way may be using child and master from trans form to child and
master main form .
Or How can I pass SQL String From SubFm To Main Form ?

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200911/1

0
Alam
11/25/2009 1:41:13 AM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
950 Views

Similar Articles

[PageSpeed] 53

To make the new data show in the main form, do a requery on the main form.
If the DoCmd.RunSQL code is on the subform, then you can go
Me.Parent.Requery



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


"Alam via AccessMonster.com" <u56406@uwe> wrote in message 
news:9f9ea960c6b92@uwe...
>I have 2 table both are exactly same
> PatientRecordTransTb And PatientRecordTb
>
> I know many programmer don't like TempTb, but in my case I don't trust 
> some
> one to mess
> with my Main record table. So simple solution is make tamp table and after
> review I click to transfer all records from temp Table to main Table So I
> have two forms .
>
> PatientRecTransFm record sources = PatientRecordTransTb
> PatientRecordMainFm record source = PatientRecordTb
>
> PatientRecTransFm  has 2 button AddRecord And Delete Record
>
> Here is a short story of my code (NOT A Actual Code)
>
> mySQLString = "INSERT INTO PatientRecordTb( 
> astName,FirstName,Status  .ect)"
> mySQLString = mySQLString & " SELECT PatientRecordTransTb.LastName,
> PatientRecordTransTb.FirstName..
> mySQLString = mySQLString & " FROM PatientRecordTransTb;"
> MsgBox Yes No
> If Yes:  Then
>               DoCmd.RunCommand acCmdSelectRecord
>        DoCmd.RunSQL ("UPDATE PatientRecordTransTb SET 
> PatientRecordTransTb.
> RecAdded = True;")
>        DoCmd.RunSQL (mySQLString)
>        Me.Requery
>        End If
> So far This was working  perfect
>
> Now I Add 2 Sub Form in PatientRec Main Fm And PatientRecTransFm
> I need to know How can I  update these 2 subform record from trans form to
> main form ??
> Is there is a way may be using child and master from trans form to child 
> and
> master main form .
> Or How can I pass SQL String From SubFm To Main Form ?
>
> -- 
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200911/1
> 


0
Jeanette
11/25/2009 2:27:52 AM
Thank’s Ms Cunningham for your quick response  

1  PatientRecTransFm record sources = PatientRecordTransTb    has
	.a)  sub form1
	.b) sub form 2

2  PatientRecordMainFm record source = PatientRecordTb            has
	.c)  sub form1
	.d) sub form 2

	
>If the DoCmd.RunSQL code is on the subform, then you can go
>Me.Parent.Requery

In both form 1 and 2,  both  Sub form a & b  And c & d are  working 
excellent in form 1 and 2.
  
Also cmd Add button transfer all data from 1) PatientRecTransFm to 
2) PatientRecordMainFm Using  :

mySQLString = "INSERT INTO PatientRecordTb ( LastName , ….e.t.c.”
mySQLString = mySQLString & " FROM PatientRecordTransTb;"
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunSQL ("UPDATE PatientRecordTransTb


I need additional SQL string statement for both Sub form a & b in my 
PatientRecTransFm  SQL string to transfer all record to Sub form c & d    

Regards,
H. Alam

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200911/1

0
Alam
11/25/2009 5:33:35 AM
Reply:

Similar Artilces:

Default workbook #2
Hi. I want to modify the style of new workbooks. To this end, I have modified the "workbook.xltx" file under: C:\Program Files\Microsoft Office\Office12\XLSTART Now when I open Excel, the blank workbook correctly looks like my modifed default... however, my modified default is not used in the following scenarios: 1) I right click on my desktop and create a new Excel workbook. 2) Within Excel, I select "New" and "Blank workbook". Any idea if I can set the deafult workbook for these scenarios? Thanks, Jim jmfoxjr@cox.net Not using 2007 but in 2003..........

Tax Schedules #2
I am trying to create a Sales tax schedule to calculate 2 taxes for one sales item. For example a $100 sales amount with a 5% tax plus a 10% tax. So want $5 tax calculated to one G/L account and $10 to another. I set up 2 different tax details , one for 5% based on sales and one for 10% based on sales. Then create a Tax schedule with the two tax details included. Then use this tax schedule for the customer but does not make the two separated calculations ? Clyde, You need to specify a different GL account number for each tax detail on the Tax Detail Maintenance screen. If that i...

Forms
I know this question has been asked several times and the same answer has been given but here goes: I created a form and put tables in the form where I can so those text boxes stay fixed. But there are places I can not create a table so the question is: How do I fix the text boxes without having them in a table? Is there a way or not? Use a table without borders. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.com "Confused...

Help with a simple formula #2
I'm new and trying to learn Excel so please excuse the simple questions. I want to create a formula on a spread sheet that will subtract the number that I will put in a new cell every month from a cell that never changes. This cell - with the answer - sits below the spreadsheet. PghPatti If I understand you correctly, you will need 3 cells. One cell, say A1, is the cell that never changes. The second cell, say B1, is the cell into which you type a number. The third cell, say C1, is the cell that has the answer of the second cell subtracted from the first cell. In the third cel...

Sharing Files #2
Hello, I was wondering, if I post an excel file to a server for sharing. How do I track changes that are made when people grab it and edit and put it back? In 2003 you can go to Tools and track changes and turn that feature on. -- Sincerely, Michael Colvin "A.S." wrote: > Hello, > I was wondering, if I post an excel file to a server for sharing. How do I > track changes that are made when people grab it and edit and put it back? ...

eConnect Installation #2
I am trying to get eConnect 8.0 installed on my computer. I have MS/ GP 8.0 installed and running fine with the sample company. When I try to install eConnect, I had issues with the connection string. I have SQL Server, GP all on one box. There is no Domain setup for our local network. I finally got the connection string to be accepted when I used the localhost IP (127.0.0.1) for the data source. (Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DYNAMICS;Data Source=127.0.0.1). Now I get to a dialog that is asking for the Domain\Login and p...

how to remove unwanted fields from customizable form
Our's is a service based company so we do not need shipping address in MS CRM. Dependencies are removed via Deployment Manager and the Mappings setting for each object. In the case of addresses there are a lot of mappings, (i.e., contacts > quotes, accounts > quotes, quotes >orders, quotes > invoices, etc. I have removed dependencies using entity mapper in Deployment Manager but could not get rid of shipping address from the forms. It gives an error message: The field you are trying to remove is required by the system or business or an event dependent field. I have also ...

COUNTIF in VBA #2
I have a userform which adds records to sheet 1. One of the textboxes is called reference and when i change the contents of this i want to make sure said contents arent already present in sheet1,col B. So i see then that i need to use COUNTIF. To check if the entry in A1 appears once in col B i used =COUNTIF(B:B,A1)=1 To check if the entry occurs more than once in the list in col B do i use =COUNTIF(B:B,A1)>=1 And how do i crowbar this into vba? For VBA im thinking something along the lines of formula = "=COUNTIF(B:B,me.reference.value)>=1" but them im lost on the message...

Lost Access to my Business Contacts Form
Hello, I am a new user of Outlook 2003 and Business Contact Manager. I have 28 contacts in my Business contacts in Business Contact Manager. Out of the blue, when I click "New" to create a new contact I get the following message: The form required to view this message cannot be displayed. Contact your administrator. When I click ok I get: Array index out of bounds. when I click on a card to open it I get: Unable to display the folder. Your profile is not configured to support this operation for this user. At some point I got this message: The custom form could not be opened. ...

temporary documents
How do I find something saved in temporary documents by accident? If you mean the Temp folder on your system, you can press Windows key + R to display the Run dialog box. Type %tmp% and press Enter. Locate the file and move it to a proper location. On the other hand, if you have edited an e-mail attachment without saving it to the hard drive first, see http://www.gmayor.com/outlook_attachments.htm. -- Stefan Blom Microsoft Word MVP "Lisa M" <Lisa M@discussions.microsoft.com> wrote in message news:009F3D91-414E-4213-AA89-B4CA5939BE8B@microsoft.com.....

SAving temporary files
So I opened a document file from my email and worked on it for awhile. I pressed the save button and the bar in the lower right hand corner saig word is saving wo.doc. But now I cannot find said word document. I have looked in my temporary internet files and cannot find it there. help! Locations shown here; http://www.howto-outlook.com/faq/securetemp.htm "emily" <emily@discussions.microsoft.com> wrote in message news:0B09317D-9AA3-4583-B701-0A0ECC04A430@microsoft.com... > So I opened a document file from my email and worked on it for awhile. I > pre...

How do I type a smiley face in an Outlook email? #2
When I type ":)" without the quotes, Outlook does not change this to a smiley face character. Auto correct is on, but there is no replacement for :) listed in the correction table. What would the syntax to change :) into a smily face character look like? Thanks in advance. -- I put junk in my email address to evade the spammers. Please take the junk out before replying. Sorry for the inconvenience. Jim ...

Is there a white paper on the differences between 1.0 & 1.2 Store.
Trying to find out what the differences or enhancements are going from 1.0 to 1.2 Store Ops. Hi Nick, See "What's New" section of MRMS help file. CP.Dinesh "Nick" wrote: > Trying to find out what the differences or enhancements are going from 1.0 to > 1.2 Store Ops. ...

Scrolling through records in a form
I now have Access 2007, and cannot scroll fast through records in a form like I could in Access 2000. Is there a way to turn something on, so I don't go one record at a time? I have to scan one record at a time to get from record 1 say to 350. DB has over 500 records. Why did they turn off the fast scroll? Thanks in advance. Bob The Dog Breeders List wrote: > I now have Access 2007, and cannot scroll fast through records in a > form like I could in Access 2000. Is there a way to turn something > on, so I don't go one record at a time? I have to scan one record at > a...

Merging 2 spreadsheets
Can I merge 2 spreadsheets based on the two left most columns and insert two new columns in the merge? Spreadsheet 1 has surname, forename, addresses. Spreadsheet 2 has surname, forename, username and password. I want to insert the username and password from Sheet 2 into Sheet 1? If anyone can help it would be great! You could use a multi-criteria index/match Something along these lines .. Sheet2's data in cols A to D where cols A, B are the match cols (surname-forename), cols C & D contain the info to be extracted into Sheet1 In Sheet1, In A2:B2 down are the coincident match...

Price Level #2
Is there any way to setup the following price level. Usage quantity is 1000 to 1999 the price is $10 ($10 should be the total price) Usage quantity is 2000 to 2999 the price is $20 ($20 should be the total price) Usage qty is > 3000 the price is $30 ($30 should be the total price) When I set up the price levels, GP multiplies the quantity times the price. which is not what I want. I would like to enter a quantity say 1500 and the system should come back with a total price of $10 or if the quantity entered is 2400 the system should price it at a total of $20. Thanks Unfort...

Filter a popup form
Greetings all. I am trying to filter a popup form based on a datasheet field. When I double click on the field 'EWO' on the datasheet I am trying to open a popup, whose record source is a view having EWO as a field, and filter it to the record clicked on the datasheet. To open the form I have the following in the double click event of the EWO field on datasheet, 'frmMain': Private Sub EWO_DblClick(Cancel As Integer) DoCmd.OpenForm "frmPopup" End Sub I can not seem to get the syntax of the filter on frmPopup though. This is what I trying. Private Sub Form_Open...

user form
Hi, i am a new user on excel VBA. 1)I know we create a user form in visual basic editor, but how do we show it in the workbooks. 2)can we edit an existing form and how do we do it? 3)is there a any way we can import a form from access to excel? I have create a database in access but now want to convert to excel due to numerous calculations require? "hngo" <hngo@discussions.microsoft.com> skrev i melding news:074867B1-0B16-4796-99A4-8032648CA886@microsoft.com... > i am a new user on excel VBA. > > 1)I know we create a user form in visual basic editor, but h...

Recovery Server #2
In Exchange 2003 Standard, is there a way to have a "stand by" server that has all information synchronized to it in the case that something happens to the production server's hardware this server can be brought online? Maybe called a Recovery Server? Thanks John: There is not a way for Exchange to do this out-of-the-box. There are a number of third parties that do this type of thing including XOSoft's HA Exchange, Neverfail, Double-Take, and Geocluster. HTH -- Jim McBee Web: http://www.somorita.com Blog: http://mostlyexchange.blogspot.com Stuff: http://geekbargain...

Query based on field in form, not working in 2007
Hi After upgrading to Access 2007 (from 2003), I have a query that has stopped working. It is something like SECELT id FROM [tbl names] WHERE ([tbl names].firstname = [forms]![My form][firstname]); It does not seem to register the value of the "firstname" textbox in the form [My Form]. Accordign to the SQL profiler, the query just sends an empty field "". Therefore instead of searching for a specific entry, I get all my entries... The query seemed to work fine in Access 2002 and 2003. When using WHERE ([tbl names].firstname LIKE "*" & [forms]![My for...

Distribution form for Payables could be on main form
When I enter a payable transaction, it would be very handy to have the distribution form at he bottom of the screen just like the Miscellaneous Check in GP 9.0 Instead I need to go to the distribution screen, even if I only want to confirm that the accounts are correct. Many times I also want to put a memo on a distribution line. Along with this it would be handy to be able to set the default as to whether the extra lines on the distribution form are open or closed. I always have to open them to see the account discription and enter a memo. I did put this all on a macro key so I can g...

Link to Data Form.
Hi this may sound simple, but i cant get my head around it, ive bee trying this for time..i would like to have a macro, so that when it i clicked it will go to data > forms. For some reason it dont seem t work, can anyone help -- Message posted from http://www.ExcelForum.com If you record a macro as you open the data form, the code should look something like this: '======================= Sub OpenTheDataForm() Range("A1").Select ActiveSheet.ShowDataForm End Sub '======================= The button on your worksheet should run this macro. What happens when y...

How do I scan in a form for entries and changes?
I have a 4 in 1 printer. How can I can in a blank form into my documents so that I can enter information into it. NOTE: I've tried to scan in the form but it gives me a jpeg (picture) format and I cannot make any modifications to it. For a one off, it is probably not worth the effort, but if you insert the jpeg so that it is behind the text, you can then type in front of it. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP, originally posted via msnews.microsoft.co...

2 separate e-mail accounts
is there a way to use outlook with two email accounts and not have them dump into the same inbox? Never mind, I finally figured it out. "endosmom" wrote: > is there a way to use outlook with two email accounts and not have them dump > into the same inbox? ...

Wrapping Text #2
I selected wrap text, but Excel isnt showing all the contents of the cell until I change the vertical height of the cell manually. It used to do this automatically. Can anyone help me? Is that a merged cell? If yes, the autofitting the rowheight won't work. Have you changed the rowheight manually? If yes, then excel will respect that setting until you autofit the rowheight once more. Confused wrote: > > I selected wrap text, but Excel isnt showing all the contents of the cell > until I change the vertical height of the cell manually. It used to do this > automatically. ...