
28-Jul-2006, 08:19 AM
|  | Guest | | | | | | | | | | Listbox dbl click Would someone be able to direct me to an article or an answer to how to dbl
clk on a record in a subform list box and have it open the record in the
parent form OrdersWDetails form.
If more info is needed the following doesn't work OrderID is Number: Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/11225-listbox-dbl-click.html
Private Sub List0_DblClick(Cancel As Integer)
Dim stDocName As String Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
Dim stLinkCriteria As String
'need to get this to open record clicked on don't know if it is DLookup or ??
'stDocName = Me.OrderID.OrdersWDetails
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
Thanks!
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh! | 
28-Jul-2006, 08:19 AM
|  | Guest | | | | | | | | | | Re: Listbox dbl click "lmv" wrote in message Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
news:4BD16916-5CD7-4FC5-BC5D-03AB7EEEB6C2@microsoft.com
> Would someone be able to direct me to an article or an answer to how
> to dbl clk on a record in a subform list box and have it open the
> record in the parent form OrdersWDetails form.
> If more info is needed the following doesn't work OrderID is Number: Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
> Private Sub List0_DblClick(Cancel As Integer)
> Dim stDocName As String
> Dim stLinkCriteria As String
> 'need to get this to open record clicked on don't know if it is
> DLookup or ?? 'stDocName = Me.OrderID.OrdersWDetails
> DoCmd.OpenForm stDocName, , , stLinkCriteria
>
> End Sub
I'm not sure I have this straight, so please check my understanding:
You have a main form named "OrdersWDetails" -- yes?
This form displays records containing a numeric OrderID field -- yes?
The OrderID field is a unique key to the records displayed by the main
form -- yes?
On that form, there's a subform -- yes?
On that subform, there's a list box named "List0" -- yes?
The list box's bound column holds OrderID values -- yes?
*IF* all that is true, then you can probably use code like this:
'----- start of suggested code -----
Private Sub List0_DblClick(Cancel As Integer)
Dim frm As Form
Set frm = Me.Parent
With frm.RecordsetClone
.FindFirst "OrderID = " & Me!List0
If .NoMatch Then
MsgBox "Order not found!"
Else
frm.Bookmark = .Bookmark
End If
End With
Set frm = Nothing
End Sub
'----- end of suggested code -----
--
Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup) | 
28-Jul-2006, 08:19 AM
|  | Guest | | | | | | | | | | Re: Listbox dbl click > You have a main form named "OrdersWDetails" -- yes? Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
YES
> This form displays records containing a numeric OrderID field -- yes?
YES (OrderID is not a visible field) Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
> The OrderID field is a unique key to the records displayed by the main
> form -- yes?
YES
> On that form, there's a subform -- yes?
YES
> On that subform, there's a list box named "List0" -- yes?
YES
> The list box's bound column holds OrderID values -- yes?
YES
SELECT Orders.OrderID, Orders.OrderDate, Orders.PurchaseOrderNumber,
qrySupplierIDLookup.SupplierName, Orders.RequestedBy FROM Orders LEFT JOIN
qrySupplierIDLookup ON Orders.SupplierID = qrySupplierIDLookup.SupplierID
ORDER BY Orders.PurchaseOrderNumber;
5 COLUMNS
0";0.7";0.8";2";0.7"
I tried the code as suggested and got Runtime Error 2452 invalid referance
to the parent property
Set frm = Me.Parent
I don't know what to try to fix it.
> *IF* all that is true, then you can probably use code like this:
>
> '----- start of suggested code -----
> Private Sub List0_DblClick(Cancel As Integer)
>
> Dim frm As Form
>
> Set frm = Me.Parent
>
> With frm.RecordsetClone
> .FindFirst "OrderID = " & Me!List0
> If .NoMatch Then
> MsgBox "Order not found!"
> Else
> frm.Bookmark = .Bookmark
> End If
> End With
>
> Set frm = Nothing
>
> End Sub
>
> '----- end of suggested code ----- | 
28-Jul-2006, 08:19 AM
|  | Guest | | | | | | | | | | Re: Listbox dbl click "lmv" wrote in message
news:12A7A8C1-FBDE-4778-A680-A0A7E675E6AE@microsoft.com
> I tried the code as suggested and got Runtime Error 2452 invalid
> referance to the parent property
> Set frm = Me.Parent
You should only get that error if the code is not executing on a
subform. Are you *sure* your listbox is on a subform, and not on the Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
main form? A subform, in this sense, is one that is displayed in a Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
subform control on the parent form -- not just a standalone form that is
related to the main form somehow.
--
Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup) | 
28-Jul-2006, 08:19 AM
|  | Guest | | | | | | | | | | Re: Listbox dbl click No I am not sure... but now I think (from your questions) it is on the main
form...
It is an unbound list box on a tab
tabSelectTransaction
Sorry, so can dbl clicking the item in the list open it within the main form?
lmv
"Dirk Goldgar" wrote:
> You should only get that error if the code is not executing on a Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225 Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
> subform. Are you *sure* your listbox is on a subform, and not on the
> main form? A subform, in this sense, is one that is displayed in a
> subform control on the parent form -- not just a standalone form that is
> related to the main form somehow.
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>
> | 
28-Jul-2006, 08:19 AM
|  | Guest | | | | | | | | | | Re: Listbox dbl click "lmv" wrote in message
news:994FC14C-A898-4EB9-A8B8-AE83150A7366@microsoft.com
> No I am not sure... but now I think (from your questions) it is on
> the main form...
> It is an unbound list box on a tab
> tabSelectTransaction
>
> Sorry, so can dbl clicking the item in the list open it within the Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
> main form?
Sure, it's even easier. Just change the code as follows:
'----- start of suggested code -----
Private Sub List0_DblClick(Cancel As Integer)
With Me.RecordsetClone
.FindFirst "OrderID = " & Me!List0
If .NoMatch Then
MsgBox "Order not found!"
Else
Me.Bookmark = .Bookmark
End If
End With
End Sub
'----- end of suggested code -----
--
Dirk Goldgar, MS Access MVP www.datagnostics.com Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
(please reply to the newsgroup) | 
28-Jul-2006, 08:19 AM
|  | Guest | | | | | | | | | | Re: Listbox dbl click PERFECT... almost can you tell me how to send the focus back to:
tabOrderDetails
thank you! :~)
"Dirk Goldgar" wrote:
> "lmv" wrote in message
> news:994FC14C-A898-4EB9-A8B8-AE83150A7366@microsoft.com
> > No I am not sure... but now I think (from your questions) it is on
> > the main form...
> > It is an unbound list box on a tab
> > tabSelectTransaction
> >
> > Sorry, so can dbl clicking the item in the list open it within the
> > main form?
>
> Sure, it's even easier. Just change the code as follows:
>
> '----- start of suggested code -----
> Private Sub List0_DblClick(Cancel As Integer)
>
> With Me.RecordsetClone Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
> .FindFirst "OrderID = " & Me!List0
> If .NoMatch Then Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
> MsgBox "Order not found!"
> Else
> Me.Bookmark = .Bookmark
> End If
> End With
>
> End Sub
> '----- end of suggested code -----
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>
> | 
28-Jul-2006, 08:19 AM
|  | Guest | | | | | | | | | | Re: Listbox dbl click "lmv" wrote in message
news:4ED2638D-C9BB-4BE5-8A82-31F724934AB9@microsoft.com
> PERFECT... almost can you tell me how to send the focus back to:
> tabOrderDetails
Is tabOrderDetails a tab control, or a page of a tab control? Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
You could try this and see if it works:
Me.tabOrderDetails.SetFocus
You'd insert that line in the code after the With ... End With block,
before the End Sub line. Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
--
Dirk Goldgar, MS Access MVP www.datagnostics.com
(please reply to the newsgroup) | 
28-Jul-2006, 08:19 AM
|  | Guest | | | | | | | | | | Re: Listbox dbl click NOW it is PERFECT!
thanks!
"Dirk Goldgar" wrote:
> "lmv" wrote in message
> news:4ED2638D-C9BB-4BE5-8A82-31F724934AB9@microsoft.com Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225 Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=11225
> > PERFECT... almost can you tell me how to send the focus back to:
> > tabOrderDetails
>
> Is tabOrderDetails a tab control, or a page of a tab control?
>
> You could try this and see if it works:
>
> Me.tabOrderDetails.SetFocus
>
> You'd insert that line in the code after the With ... End With block,
> before the End Sub line.
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>
> | 
Support Us! Become a Promoter! | | Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh! | (View-All)
Members who have read this thread : 0
| | There are no names to display. | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Tools | Search | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is On | | | | » Gurbani Jukebox | Listen to Gurbani while surfing SPN! | » Active Discussions | | | | | ਨਾਮਾ Today 06:37 AM 2 Replies, 45 Views | | | | | | | | | | | | | | | | | | | | | | | | | » Books You Should Read... | | | |