Heenan, Lambert
Lambert.Heenan at AIG.com
Mon Feb 12 14:40:08 CST 2007
You could to this... Private Sub AM_DblClick(Cancel As Integer) Dim poustia As String Dim stdocname As String stdocname = "MT_basic_char" If IsNull(num_mitroou) Then DoCmd.OpenForm stdocname,,,,,acDialog DoCmd.GoToRecord acDataForm, stdocname, acNewRec Me!AM = Forms(stdocname)!AM DoCmd.Close acForm, stdocname else poustia = Me!num_mitroou DoCmd.OpenForm stdocname, , , "num_mitroou= " & poustia End If End Sub The trick to this is that you open stdocname in dialog mode. That causes the calling code to wait until either the opened form closes, or it is made invisible. So if the MT_basic_char form's "Close" button is modified from DoCmd.Close acFrom, Me.Name To Me.Visible = False Then when the user hits the close button the form will be hidden, the calling code will resume execution, and it can pick up the value entered with the line "Me!AM = Forms(stdocname)!AM", and then you code continues by actually closing the called form. HTH Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kostas Konstantinidis Sent: Monday, February 12, 2007 2:43 PM To: Access Developers discussion and problem solving Subject: [AccessD] How to transfer text.. hi group, On a double click on a form I use the follown: Private Sub AM_DblClick(Cancel As Integer) Dim poustia As String Dim stdocname As String stdocname = "MT_basic_char" If IsNull(num_mitroou) Then DoCmd.OpenForm stdocname DoCmd.GoToRecord acDataForm, stdocname, acNewRec else poustia = Me!num_mitroou DoCmd.OpenForm stdocname, , , "num_mitroou= " & poustia End If End Sub what I want to do is after the new record update and closing the stdocname the text of AM's field to be tranfered to the AM field of the opened form Many thank's /kostas -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com