Find Macro on a Tabbed Form

R

Randy Hartwick

I have four related tables - Applicant, Applicant Problem, Pistol, &
Reference that I view and enter data to through a tabbed form. The main form
is called "Application Data" and contains the fields - CtlNum, File Number, &
Permit Number along with the tabs Personal Data (form Application, table
Applicant), Permit Information (form Dates, table Applicant), References
(form Reference, table Reference), Problems (form Problems, table Problem),
Pistols (form Pistol, table Pistol).

I have tried to use the find macro with the following in the click event
code of a control button:

Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

I have tried using this control on both the main form Application Data
(table Applicant) and on the form Application in the tab Personal Data. Both
of these are based on the same table Applicant.

When I attempt the search on a field (e.g. LastName) with a known value I
receive the message "Search item not found".

When the same search is performed on the Application form stand alone (not
as a tab in the main form), the same search returns the record.

I assume the problem lies in the first statement (SetFocus), however, I am
at a loss to determine what I should be using.

Thanks,

Randy Hartwick
 

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