Form Button Trouble (accidentally posted in reports section)

Mwildrick

New member
Local time
Today, 17:52
Joined
Jun 7, 2001
Messages
9
On a form im using, I have a button that, when clicked, is supposed to search for a certain box number. The only problem is, when i click it, it brings up the "find" box, and i have to type it in again (similar to the find files or folders on windows 9x). There should be a way that, when i type in the category, would find me the box number without me having to type it in again in the Find field. How is this so?
I know i made this really hard to explain probably, so let me know if i need to clear it up.
 
Did you use the wizard to create the "Find" button? I think that the wizard sends menu commands, and intentionally brings up the dialog box.

Instead, you'll probably have to create a command button manually, and use a statement like:
Dim rs as object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Record_ID] = " & DLookup("[Record_ID]", "TableOfBoxes", "BoxNumber = " & [ControlWithBoxNumberAlreadyInIt])
Me.Bookmark = rs.Bookmark

Where:
Record_ID is the identifying field of the table;
TableOfBoxes is the table being searched, and;
BoxNumber is your field in that table containing Box numbers, and;
[ControlWithBoxNumberAlreadyInIt] is the control on the form where you've already typed the box number.

Good luck, Tell me if it works.

Matt
 

Users who are viewing this thread

Back
Top Bottom