Thanks RKC !
first part of code going fine. Splitting of openarg is OK, and I manage to
control data in ListBox on form2.
Are You able to help me with whole story ?
I have form ContactAction1 and ContactAction2
Fields are: CompanyID,ContactPerson,ContactPhone
After User input CompanyID it is able to open form "ReachPerson"
Private Sub Command201_Click()
On Error GoTo Err_Command201_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ReachPerson"
rem Text1Name and Text2Name are controls with Contact Person Name
and ContactPhone
DoCmd.OpenForm stDocName, acNormal, , , acFormPropertySettings,
acWindowNormal, Me.CompanyID & ";"& Screen.ActiveForm & ";" & Text1Name &
";" & Text2Name
Exit_Command201_Click:
Exit Sub
Err_Command201_Click:
MsgBox Err.Description
Resume Exit_Command201_Click
End Sub
After user oppened form "ReachPerson" he selecting person from List0 (
List0 is filled exactly as it should be- EXCELLENT !)
Private Sub Accept_Click()
On Error GoTo Err_Accept_Click
Rem HERE IS PROBLEM !
Forms(v(1)).Controls(v(2)) = Me.List0
Forms(v(1)).Controls(v(3)) = Me.List0.Column(1)
DoCmd.Close acForm, "ReachPerson"
Exit_Accept_Click:
Exit Sub
Err_Accept_Click:
MsgBox Err.Description
Resume Exit_Accept_Click
End Sub
Thank You in advance,
DK
"rkc" <rk*@rochester.yabba.dabba.do.rr.bomb> wrote in message
news:Av*******************@twister.nyroc.rr.com...
DK wrote: Thanks, but point is that I need to return value of ListBox from Form2
into Form from which form 2 was oppened.
So pass three pieces of information in openargs instead of one.
"companyid;form2;controlOnform2"
dim v as variant
v = split(me.openargs,";")
"SELECT From Contacts.... where CompanyID=" & v(0)
Forms(v(1)).Controls(v(2)) = valueOflistbox