Searching for records

F

Fie

Hi,


I have set up a search form where a user can enter in name of employee
or depo, i have a field in my employee table called full_name which
contains employees name i.e Alan Paterson, when searching for record
all results are displayed in a list box (this part works on my form). I
have set up the list box so that when you double click on a employee it
opens up another form frmResults which displays all data related to the
selected employee, but there seems to be an error with my code and i am
a tad lost.

Private Sub ShowRecord_Click()
'Find a selected record, then close the search dialog box

DoCmd.OpenForm "Srch_Frm_Res1", , , _
"(tblEmployees.Full_ Name) Like ""*" & Me.SrchLst.Column(0) &
"*"""

'Close the dialog box
DoCmd.Close acForm, "Srch_Frm1"

End Sub


its doesnt seem to like

DoCmd.OpenForm "Srch_Frm_Res1", , , _
"(tblEmployees.Full_ Name) Like ""*" & Me.SrchLst.Column(0) &
"*"""

i think it may have something to do with fact the full_name field
contains 2 values i.e Ian Grant instead of just 1

can anyone help me with this please

fie
 
B

BIGRED56

Hi umm the way i displayed a form from double clicking my list fom was

DoCmd.OpenForm "form name u want opened", , , _
"[table1.field] = " & "'" & Me.List.Column(0) & "'"
DoCmd.close acForm,"Present form"

This should work... Also can you tell me the code u used to link your search
form to your list and how it updates and requerys each time..
Thanks..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top