tanolalano
Technical User
Hi all,
I Have a form with a click button that prompt a message box for choosing to send the value of some controls in the form to an addnew DAO(VbNo) or open a popup form(unbound) and change some value to send to the addnew DAO (VbYes).
As Well, I haven't found the right solution searching in the forum.
I try to dim public var on the popup form but how I catch it in the form?
Here my code
Any Help would be appreciated
I Have a form with a click button that prompt a message box for choosing to send the value of some controls in the form to an addnew DAO(VbNo) or open a popup form(unbound) and change some value to send to the addnew DAO (VbYes).
As Well, I haven't found the right solution searching in the forum.
I try to dim public var on the popup form but how I catch it in the form?
Here my code
Code:
[COLOR=red]'********On popup form ************** [/color]
Public pag_ord As Boolean
Public Caus As String
Public impor As Currency
Private Sub Form_AfterUpdate()
Caus = Forms![imp_nota]![Causale]
pag_ord = Forms![imp_nota]![pagato]
impor = Forms![imp_nota]![import]
End Sub
Private Sub Close_Click ()
Me.visble= false
end sub
[COLOR=red]'**********Form *********[/color]
Private Sub save_Click()
If vbYes = MsgBox("ect....")
DoCmd.OpenForm "popupForm", , , , , acDialog
[COLOR=red]'then i set the var on the popup
'but How I catch them and continue the code?
' i try this code but nothing happen[/color]
Caus_frm1 = "Caus"
pag_frm1 = pag
impor_frm1 = import
DoCmd.Close , "popupForm"
Set db = CurrentDb()
Set rs1 = db.OpenRecordset("Ordini", dbOpenDynaset)
rs1.AddNew
rs1![Totale] = impor_frm1
rs1![pagato] = pag_frm1
'etc etc
Else
'Standard Dao Add
Set db = CurrentDb()
Set rs1 = db.OpenRecordset("Ordini", dbOpenDynaset)
rs1.AddNew
rs1![Totale] = Me.totale
rs1![pagato] = me.pagato
'etc etc
End if
Any Help would be appreciated