Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass values from one form to other form

Status
Not open for further replies.

xerife007

Technical User
May 7, 2002
40
PT
Hi forum

I have this code in one frmFind and in this form i have a List view that give me the search result when i click in the list view it pass the id to frmProcess.

the code in listview in frmFind is :

Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)

Dim IdProcesso As String
IdProcesso = Item.Text

frmProcesso.txtfields(0).Text = IdProcesso
End Sub

the code in frmProcess is that receipt the value from frmFind Listview:

Private Sub Form_Load()
On Error GoTo TrataErro

Dim IdProc As String

If PesquisaIsLoaded(frmPesquisa) = True Then
IdProc = ObterProcesso()
End If

Set oRsProc = oCn.LigaProcesso(IdProc)

'If txtfields(0).Enabled = False Then
oRsProc.MoveLast

IdProc = oRsProc.Fields("PK_Processo")

' lblPosicao.Caption = oRs.AbsolutePosition
'End If

Set oRsDocComp = oCn.LigaProcessoDts_Doc_Comprador(IdProc)
Set oRsDocEscrit = oCn.LigaProcessoDts_Doc_Escritura(IdProc)
Set oRsDocFiador = oCn.LigaProcessoDts_Doc_Fiador(IdProc)
Set oRsDocImovel = oCn.LigaProcessoDts_Doc_Imovel(IdProc)
Set oRsDocPosEscrit = oCn.LigaProcessoDts_Doc_Pos_Escrit(IdProc)
Set oRsDocVendedor = oCn.LigaProcessoDts_Doc_Vendedor(IdProc)
Set oRsPedAvalia = oCn.LigaProcessoDts_Pedido_Avalia(IdProc)
Set oRsFechProc = oCn.LigaProcessoEncerra_Proc(IdProc)
Set oRsDocFactura = oCn.LigaProcessoFacturacao(IdProc)
Set oRsProcAquis = oCn.LigaProcessoTrat_proc_aquisicao(IdProc)

Call LigaDBProcObject(oRsProc)
Call LigaDbDocCompObject(oRsDocComp)
Call LigaDbDocEscritObject(oRsDocEscrit)
Call LigaDbDocFiadorObject(oRsDocFiador)
Call LigaDbDocImovelObject(oRsDocImovel)
Call LigaDbDocPosEscritObject(oRsDocPosEscrit)
Call LigaDbDocVendedorObject(oRsDocVendedor)
Call LigaDbPedAvaliaObject(oRsPedAvalia)
Call LigaDbFechProcObject(oRsFechProc)
Call LigaDbDocFacturaObject(oRsDocFactura)
Call LigaDbProcAquisObject(oRsProcAquis)


My question is , how can i pass the value from the frmfind to frmProcess.

i will be gratful,
Best Regards
PJM
 
A Gobal var will retain its value while the application is running.
 
Instead of using a global variable, use a Public variable... not that global doesn't work, it will, but global variables are only hanging around for backwards compatibility.

There's much to be said for the proper implementation of variable types. Do a search or two, you'll find some examples.

[fish] No Dolphins were harmed in the posting of this message... Dolphin Friendly Tuna!
 
this question was still being discussed a whopping 2 days ago in thread222-538591 with the topic of Passing a value from one form to another form.

Hmmmm Search might have worked for you....do you think?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top