Problems with FIND and display record (1 Viewer)

slcollie

Registered User.
Local time
Today, 02:35
Joined
Jun 6, 2000
Messages
20
Thank you for your quick reply yesterday. I just have a couple of problems...

I do not fully understand the criteria I am using in my search query, and am having problems because rather than letting me input my search items into the 4 boxes, it is automatically bringing up a parameter box asking for each of the 4 items.

I think this is due to the fact I do not fully understand how the criteria in my query works, and am inputting it incorrectly.

Like[Forms]!{frmFormName].[txtsearch1]&"*"

I presume I am to enter my own form name where the in the syntax where FormName appears (do I need the 'frm' in front of this?). Also I presume I have to increment the txtsearch for each of the 4 fields.

If I enter my search criteria into the parameter boxes the FIND works just as i'd hoped - it brings up a choice of records inside a list box (which is great). But I do not understand the next step - 'In the after update procedure for each of the searches requery the list box'. Are you referring to the txt boxes properties (after update)?. Anyway I have set the double click procedure to open my form which contains the data I want o view, but of course it isn't showing the record i've clicked on because i've missed something out.

I would appreciate it if you could advise me. Thank you very much for your help so far it has been invaluable.
Sarah P
 

Mitch

Registered User.
Local time
Today, 02:35
Joined
May 23, 2000
Messages
31
Hi again,
The like statement should be in the format below -
Like [Forms]![YourFormName].[YourSearchBox] & "*"
and it will work without the input boxes. The requery of the list box on the Afterupdate procedure ensures the list it modified when you change your criteria and is simply -
[YourListBox].Requery

As for not opening the new form at the correct record you have missed out your link criteria it should look something like this -

Dim stDocName as String, stLinkCriteria as String

stDocName = "FormYouWishToOpen"
stLinkCriteria = "[YourKeyField]=" & "'" & [YourListBox] & "'"

Docmd.OpenForm stDocName,,,stLinkCriteria

Sorry if all the frm's confused you it's just a standard naming convention. Hope this helps.

Mitch.
 

Users who are viewing this thread

Top Bottom