If you set the list box forms Popup property to "Yes" that will keep it on
top and allow you to run two actions from the listbox form :-
1 Close existing main form
2 Openform based on new record
I still wonder why you don't use a control such as a multitab control on
your main form. It increases your real estate considerably - there is a down
side of course as it may take longer to load with more controls.
If you used a subform, you could use the selection of the listbox to set the
recordsource of filter for the subform and then run a refresh command.
Secret Squirrel said:
There isn't enough room on my form to put the list box. That's why I was
trying to this route.
:
If you want to have the main form open all the time what is stopping you from
placing a subform on the main and refreshing that when the listbox record is
selected?
:
Thanks for the info but I think I'm going to take a different route. I'm
going to put a command button on my main form to open the list box form. The
main form will always stay open but the list box form will open on top of the
main form. The user can then click the record they would like to go to and
have the main form jump to that record but the list box form stays opened
until they click the close button. I was thinking something like this but
it's not working.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Forms]![frmARRMA]![ID] = '" & Me![RMAList] & "'"
Me.Bookmark = rs.Bookmark
:
Make sure that your listbox has as the bound column the column, that
contains the record identifier that you wish open.
Put in the Double click Event of the listbox
DoCmd.OpenForm "NewFormName", acNormal, ,Recordid = Form!Oldform!listbox
DoCmd.Close acForm Me.Name
Hope it helps,
Nick
:
I have a list box on an unbound form that I would like to open another form
and go to a specific record. The reason I'm using a seperate form is because
I have no room left on my main form to put my list box. So the users will
open this form to select the record they want to go to and then click a
command button and have it open my main form and go to that record. How would
I write the code for this? The field I'm using to select the record in my
list box is called "RMA". Oh and it should also close this unbound form once
the command button is clicked.