List Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
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
 
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?

Secret Squirrel said:
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

Biz Enhancer said:
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
 
There isn't enough room on my form to put the list box. That's why I was
trying to this route.

Biz Enhancer said:
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?

Secret Squirrel said:
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

Biz Enhancer said:
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.
 
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.

Biz Enhancer said:
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?

Secret Squirrel said:
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.
 
I agree with you about the multi-tab form style but this db is already in use
so I can't go back and re-invent the wheel right now. Maybe in the next
version I can switch it over to a tab format.

I have the popup property set to yes and when I open my main form and then
click the command button it opens the list box form. I don't want to close my
main form at this point. I want to keep it open underneath the list box form
and once I select a record from my list box property I want the main form to
go to that record. How do I write this code?

Biz Enhancer said:
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.

Biz Enhancer said:
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.
 
I take it then that your not working on a split database.
So does this mean that you can't make any alteration to the main form?

Secret Squirrel said:
I agree with you about the multi-tab form style but this db is already in use
so I can't go back and re-invent the wheel right now. Maybe in the next
version I can switch it over to a tab format.

I have the popup property set to yes and when I open my main form and then
click the command button it opens the list box form. I don't want to close my
main form at this point. I want to keep it open underneath the list box form
and once I select a record from my list box property I want the main form to
go to that record. How do I write this code?

Biz Enhancer said:
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.
 
I am working on a split database. I can make small modifications like adding
command buttons etc. But the layout needs to remain the same for the time
being.

Biz Enhancer said:
I take it then that your not working on a split database.
So does this mean that you can't make any alteration to the main form?

Secret Squirrel said:
I agree with you about the multi-tab form style but this db is already in use
so I can't go back and re-invent the wheel right now. Maybe in the next
version I can switch it over to a tab format.

I have the popup property set to yes and when I open my main form and then
click the command button it opens the list box form. I don't want to close my
main form at this point. I want to keep it open underneath the list box form
and once I select a record from my list box property I want the main form to
go to that record. How do I write this code?

Biz Enhancer said:
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.

:

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.
 
Try something like:

Private Sub List0_Click()
Dim f As String
f = Me.List0.Value
'Shift focus to main form here, then
DoCmd.ApplyFilter , Forms!client!ClientID = f
End Sub


Secret Squirrel said:
I am working on a split database. I can make small modifications like adding
command buttons etc. But the layout needs to remain the same for the time
being.

Biz Enhancer said:
I take it then that your not working on a split database.
So does this mean that you can't make any alteration to the main form?

Secret Squirrel said:
I agree with you about the multi-tab form style but this db is already in use
so I can't go back and re-invent the wheel right now. Maybe in the next
version I can switch it over to a tab format.

I have the popup property set to yes and when I open my main form and then
click the command button it opens the list box form. I don't want to close my
main form at this point. I want to keep it open underneath the list box form
and once I select a record from my list box property I want the main form to
go to that record. How do I write this code?

:

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.

:

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.
 

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

Back
Top