displaying data problem

hi ...
i have this form namd view in which it has text fields such as (file no,year ,subject,coments, date,etc..)
and one combo box(fileno,year,subject) and a search text field and a search button ...

when the user wants to search a specific thing he has to choose one of the fields in the combo box and write in the search text field ..

for example,,,
if the user wants fileno 5 he goes and chooses the file no from the combo box and enter number 5 in the search text field and then the information will be displayed

i want these information to be displayed in another form not in the same form
i don't know how to do this? i only know how to display it in the same form

i created another form calledreference and put the same text fields that exits in te vie form but i don't know how the information can be displayed in this form according to the fileno the user choose

this is my code for the view form:
Dim db As Database
Dim rs As Recordset
Dim ws As Workspace

Private Sub cmdSearch_Click()
Dim searchquery As String
'If cmbSearch = "" Then
' MsgBox "Select Search Type"
'Else
' If txtSearch = "" And cmbSearch.List(cmbSearch.ListIndex) <> "Specific Period" Then
' MsgBox "Enter the keyword"
' Else

If cmbSearch.List(cmbSearch.ListIndex) = "Fileno" Then
SearchKeyword = txtSearch.Text
If txtSearch <> "" Then
searchquery = "[FileNo] like '*" & txtSearch & "*'"
Reference.Show
rs.FindNext searchquery
If rs.NoMatch Then
rs.FindFirst searchquery

If rs.NoMatch Then
MsgBox "No match!"
Else
fill_data
End If

Else
fill_data
End If
Else
MsgBox ("Enter Search text")

End If


ElseIf cmbSearch.List(cmbSearch.ListIndex) = "Year" Then
SearchKeyword = txtSearch.Text
If txtSearch <> "" Then
searchquery = "[Year] like '*" & txtSearch & "*'" ' Or "[Year] like '*" & txtSearch & "*'" ' or TEL like '*" & txtSearch & "*' or FAX like '*" & txtSearch & "*' or [P O Box] like '*" & txtSearch & "*' or [E-mail] like '*" & txtSearch & "*' or Website like '*" & txtSearch & "*' or LocationID like '*" & txtSearch & "*' or Activity like '*" & txtSearch & "*' or Category like '*" & txtSearch & "*' or Raw like '*" & txtSearch & "*'"

rs.FindNext searchquery
If rs.NoMatch Then
rs.FindFirst searchquery

If rs.NoMatch Then
MsgBox "No match!"
Else
fill_data
End If

Else
fill_data
End If
Else
MsgBox ("Enter Search text")
End If


End If

End Sub

Private Sub Form_Load()
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(DBName, False, False, ";pwd=" & password)
Set rs = db.OpenRecordset("select * from View", dbOpenDynaset)

If (ComeFromAdd = 1) Then
rs.FindNext LastEntered
If rs.NoMatch Then
rs.FindFirst LastEntered
End If
ComeFromAdd = 0
End If
ComeFromView = 1

cmbSearch.AddItem "Fileno"
cmbSearch.AddItem "Year"

txtFileNo = rs!FileNo
txtYear = rs!Year
End Sub

Private Sub fill_data()

If rs.BOF Or rs.EOF Then
txtFileNo = ""
txtYear = ""

txtSubject = ""
txtDate = ""

txtTo = ""
txtSendTo = ""

txtDir = ""
txtComments = ""
Else

If IsNull(rs!FileNo) Then txtFileNo = "" Else txtFileNo = rs!FileNo
If IsNull(rs!Year) Then txtYear = "" Else txtYear = rs!Year


If IsNull(rs!Subject) Then txtSubject = "" Else txtSubject = rs!Subject
If IsNull(rs!Date) Then txtDate = "" Else txtDate = rs!Date

If IsNull(rs!To) Then txtTo = "" Else txtTo = rs!To
If IsNull(rs!SendTo) Then txtSendTo = "" Else txtSendTo = rs!SendTo


If IsNull(rs!Directorate) Then txtDir = "" Else txtDir = rs!Directorate
If IsNull(rs!Comments) Then txtComments = "" Else txtComments = rs!Comments
End If


txtFileNo.Locked = True
txtYear.Locked = True

End Sub

and this is my code for the reference form:

Dim db As Database
Dim rs As Recordset
Dim ws As Workspace
Private Sub Form_Load()
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(DBName, False, False, ";pwd=" & password)
Set rs = db.OpenRecordset("select * from View", dbOpenDynaset)

If (ComeFromAdd = 1) Then
rs.FindNext LastEntered
If rs.NoMatch Then
rs.FindFirst LastEntered
End If
ComeFromAdd = 0
End If
ComeFromView = 1

Reference.txtFileNo = View.txtFileNo
'txtFileNo = rs!FileNo
txtYear = rs!Year
txtSubject = rs!Subject
txtDate = rs!Date
txtTo = rs!To
txtSendTo = rs!SendTo
txtDir = rs!Directorate
txtComments = rs!Comments

End Sub

any help please?
[5492 byte] By [nawaray] at [2007-11-20 0:39:00]
# 1 Re: displaying data problem
If you know how to display it in one form, you can display it in any form. Just reference the form first, then the object.

For example:
frmView.txtFileNo.Text = "Here is the file number"
PeejAvery at 2007-11-9 19:57:07 >
# 2 Re: displaying data problem
thankx:)
nawaray at 2007-11-9 19:58:07 >
# 3 Re: displaying data problem
You're welcome.
PeejAvery at 2007-11-9 19:59:06 >