Keyword Search Problems

Tezcatlipoca

Registered User.
Local time
Today, 06:22
Joined
Mar 13, 2003
Messages
246
The Layout:

1 x Table (coredata) which holds the details
1 x Form (Keyword) which contains the text box users fill out to make the search. The text box is unbound, and has the name 'Keyword'. The 'Search' button has the following code:
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
DoCmd.OpenForm "coredata3"
Exit_Command5_Click:
Exit Sub
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End Sub

1 x Query (coredata Query1) which has all of the various table fields checked to display in the final form, and has the following code in the Criterea section of the 'Student' field:
Like [Forms]![frmKeyword]![keyword]
1 x Form (coredata3) which will display the filtered data based on the box from the 'Keywrod' form. This form has the following entered into it's Record Source field:
SELECT [coredata].[Name], [coredata].[Address], [coredata].[Phone], [coredata].[Student], [coredata].[Course Start], [coredata].[Course End], [coredata].[Agent], [coredata].[Country], [coredata].[Lessons], [coredata].[Course Type], [coredata].[Details], [coredata].[Last Visit Date] FROM coredata WHERE ((([coredata].[Student]) XXX [Forms]![frmKeyword]![Keyword]));


The Desired Effect

The user - via a button on my switchboard - opens up the form frmKeyword, enters the name - or fragment of a name - of a student into the text box, then clicks 'Search'. Any record where the Student field contains the exact name, or part of the name, entered by the user is filtered and displayed through the form 'Coredata3'.


The Current Effect

At the moment, I can enter data in the text box, but everytme I click 'Search', a window for the results form appears, but is completely greyed out. Not only that, but the whole of Access appears to freeze and locks up, from which I can only exit by using Ctrl + Alt + Dlt and ending the Access task.


Where am I going wrong?
 
Sorry, the line of code that says:
FROM coredata WHERE ((([coredata].[Student]) XXX [Forms]![frmKeyword]![Keyword]));

Does in fact read:
FROM coredata WHERE ((([coredata].[Student]) Like [Forms]![frmKeyword]![Keyword]));
 
Can anyone assist with this, please? It's driving me nuts trying to get it working.
 

Users who are viewing this thread

Back
Top Bottom