Listbox SEARCH Dev Ashish

G

Guest

I am using the search code from Dev Ashish and there is an unbound lstResult
box that searches fields that it gets from my tbl, qry etc list that are on
my computer.

There is an orderID field available in my qry and I want to be able to dbl
clik the unbound lstresult record and have it open in the form. I have tried
the following and a peramiter box keeps opening asking for the ProjectID. If
I put nothing in /or somethin in the box the form opens but not with the
record from the unbound search. Does anyone have an idea how to get it to
open to the specific record?
Thanks

Private Sub lstResult_DblClick(Cancel As Integer)
Dim stDocName As String
Dim StLinkCriteria As String

stDocName = "OrdersWDetails" 'my form
StLinkCriteria = "[OrderID]=" & Me![lstResult]

DoCmd.OpenForm stDocName, , , StLinkCriteria

End Sub
 
G

Guest

Ok so can you tell me if it SHOULD work to dblclk on the record in the search
to open a form?
And is the code I have the right way to accomplish that providing I can
figure out why projectID peramiter is popping up?
Thanks
Arvin Meyer said:
I did some of the beta testing on the Search Wizard when Dev and Terry first
wrote the code. I just reviewed the original code, and the production code
and there is no reference to ProjectID. You must have something in your
current application that uses a ProjectID.
--
Arvin Meyer, MCP, MVP
Free MS-Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

lmv said:
I am using the search code from Dev Ashish and there is an unbound
lstResult
box that searches fields that it gets from my tbl, qry etc list that are
on
my computer.

There is an orderID field available in my qry and I want to be able to dbl
clik the unbound lstresult record and have it open in the form. I have
tried
the following and a peramiter box keeps opening asking for the ProjectID.
If
I put nothing in /or somethin in the box the form opens but not with the
record from the unbound search. Does anyone have an idea how to get it to
open to the specific record?
Thanks

Private Sub lstResult_DblClick(Cancel As Integer)
Dim stDocName As String
Dim StLinkCriteria As String

stDocName = "OrdersWDetails" 'my form
StLinkCriteria = "[OrderID]=" & Me![lstResult]

DoCmd.OpenForm stDocName, , , StLinkCriteria

End Sub
 
A

Arvin Meyer [MVP]

It won't work to double-click on lstResults because there is code in the
Click event which will always fire. You typically not have code in both
events. Add a command button and code that to open the item selected in the
list box.

--
Arvin Meyer, MCP, MVP
Free MS-Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

lmv said:
Ok so can you tell me if it SHOULD work to dblclk on the record in the
search
to open a form?
And is the code I have the right way to accomplish that providing I can
figure out why projectID peramiter is popping up?
Thanks
Arvin Meyer said:
I did some of the beta testing on the Search Wizard when Dev and Terry
first
wrote the code. I just reviewed the original code, and the production
code
and there is no reference to ProjectID. You must have something in your
current application that uses a ProjectID.
--
Arvin Meyer, MCP, MVP
Free MS-Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

lmv said:
I am using the search code from Dev Ashish and there is an unbound
lstResult
box that searches fields that it gets from my tbl, qry etc list that
are
on
my computer.

There is an orderID field available in my qry and I want to be able to
dbl
clik the unbound lstresult record and have it open in the form. I have
tried
the following and a peramiter box keeps opening asking for the
ProjectID.
If
I put nothing in /or somethin in the box the form opens but not with
the
record from the unbound search. Does anyone have an idea how to get it
to
open to the specific record?
Thanks

Private Sub lstResult_DblClick(Cancel As Integer)
Dim stDocName As String
Dim StLinkCriteria As String

stDocName = "OrdersWDetails" 'my form
StLinkCriteria = "[OrderID]=" & Me![lstResult]

DoCmd.OpenForm stDocName, , , StLinkCriteria

End Sub
 
G

Guest

I don't see the clk event... anyway
I would code a button IF I knew how to reference the lstResults and direct
it to the OrderID but I don't which is why I posted.

Would you be able to tell me how?
Thanks alot!
lmv

Arvin Meyer said:
It won't work to double-click on lstResults because there is code in the
Click event which will always fire. You typically not have code in both
events. Add a command button and code that to open the item selected in the
list box.

--
Arvin Meyer, MCP, MVP
Free MS-Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

lmv said:
Ok so can you tell me if it SHOULD work to dblclk on the record in the
search
to open a form?
And is the code I have the right way to accomplish that providing I can
figure out why projectID peramiter is popping up?
Thanks
Arvin Meyer said:
I did some of the beta testing on the Search Wizard when Dev and Terry
first
wrote the code. I just reviewed the original code, and the production
code
and there is no reference to ProjectID. You must have something in your
current application that uses a ProjectID.
--
Arvin Meyer, MCP, MVP
Free MS-Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

I am using the search code from Dev Ashish and there is an unbound
lstResult
box that searches fields that it gets from my tbl, qry etc list that
are
on
my computer.

There is an orderID field available in my qry and I want to be able to
dbl
clik the unbound lstresult record and have it open in the form. I have
tried
the following and a peramiter box keeps opening asking for the
ProjectID.
If
I put nothing in /or somethin in the box the form opens but not with
the
record from the unbound search. Does anyone have an idea how to get it
to
open to the specific record?
Thanks

Private Sub lstResult_DblClick(Cancel As Integer)
Dim stDocName As String
Dim StLinkCriteria As String

stDocName = "OrdersWDetails" 'my form
StLinkCriteria = "[OrderID]=" & Me![lstResult]

DoCmd.OpenForm stDocName, , , StLinkCriteria

End Sub
 

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