find (search) function from modal dialog

  • Thread starter Thread starter TNL
  • Start date Start date
T

TNL

Hi,
I use "docmd.openform" to open a form in modal dialog modus.
The user must click "OK" or "Cancel" button to close this dialog.
But the users cann't longer access the toolbar or Menus from this form.

I want to enable the function "search", standard function of access, with a
commandbutton and the code
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
or
RunCommand acCmdFind

but it doesn't work, I think, is isn't possible, why my form is opened as
modal.

How can I do?

Thanks
TNL
 
One trick I have found is to open the form not using dialog mode. Then
program a loop to see if the form has been closed yet as follows:

DoCmd.OpenForm strFormName
Do While SysCmd(acSysCmdGetObjectState, acForm, strFormName)>0
Do Events
Loop

You should also investigate using the recordSetClone to find records. Here
is a sample to move to a record based on a given value for a field:

Me.RecordSetClone.FindFirst "FieldName='Value'" 'Leave off the single
quotes if field is numeric
Me.Bookmark=Me.RecordSetClone.Bookmark

The second line moves the current record pointer for the form to the same as
the recordSetClone if found.

Dave C
 
Back
Top