hardik_088
Registered User.
- Local time
- Today, 15:07
- Joined
- May 31, 2011
- Messages
- 82
hi guys,
I have SearchLaptops form that contain sub form "SubLaptops" and i have button in SerachLaptops form. when I click it it will find data and show me in SubLaptops form and when i click on record selector of SubLaptops I want to open Laptops form that is bound with Laptops table.And I want that Laptops form should show me all record that are in my SubLaptops form and when Laptops form will open i want to display that specific record where i clicked in record selector of SubLaptops. what i should do for this task.
serial number is primary key
-----------------
code in my SubLaptops form is here
---------------------
Option Compare Database
Option Explicit
Private Sub Form_DblClick(Cancel As Integer)
Dim frm As Form
For Each frm In Forms
If frm.Name = "Laptops" Then Exit For
Next frm
If frm.Name <> "Laptops" Then
Call DoCmd.OpenForm("Laptops", acNormal)
DoEvents
Set frm = Forms("Laptops")
End If
Call frm.SelectMe(me.serial number)
End Sub
----------------
Code in Laptops form is here
----------------
Option Compare Database
Option Explicit
Public Sub SelectMe(lngID As Long)
With Me.Recordset
.Index = Me.[serial number]
Call .Seek("=", lngID)
End With
End Sub
Thanks a lot
I have SearchLaptops form that contain sub form "SubLaptops" and i have button in SerachLaptops form. when I click it it will find data and show me in SubLaptops form and when i click on record selector of SubLaptops I want to open Laptops form that is bound with Laptops table.And I want that Laptops form should show me all record that are in my SubLaptops form and when Laptops form will open i want to display that specific record where i clicked in record selector of SubLaptops. what i should do for this task.
serial number is primary key
-----------------
code in my SubLaptops form is here
---------------------
Option Compare Database
Option Explicit
Private Sub Form_DblClick(Cancel As Integer)
Dim frm As Form
For Each frm In Forms
If frm.Name = "Laptops" Then Exit For
Next frm
If frm.Name <> "Laptops" Then
Call DoCmd.OpenForm("Laptops", acNormal)
DoEvents
Set frm = Forms("Laptops")
End If
Call frm.SelectMe(me.serial number)
End Sub
----------------
Code in Laptops form is here
----------------
Option Compare Database
Option Explicit
Public Sub SelectMe(lngID As Long)
With Me.Recordset
.Index = Me.[serial number]
Call .Seek("=", lngID)
End With
End Sub
Thanks a lot
Last edited: