List to find records from a tab control page to another.

A

Adnan

I have a tab control on a bound form (Page 1, and Page 2), Page 1 has data
and page 2 has a list for search (displays same records as form does). On
double click, I need to find that record where the data are (page 1) and set
focus anywhere there, I tried the following but had no luck.

DoCmd.GoToRecord acDataForm, "frmMain", acGoTo, "[ID] = " & Me.List1
Me.ID.SetFocus

Thanks for any help provided!
Adnan
 
R

Rick Brandt

Adnan said:
I have a tab control on a bound form (Page 1, and Page 2), Page 1 has
data and page 2 has a list for search (displays same records as form
does). On double click, I need to find that record where the data are
(page 1) and set focus anywhere there, I tried the following but had
no luck.

DoCmd.GoToRecord acDataForm, "frmMain", acGoTo, "[ID] = " &
Me.List1 Me.ID.SetFocus

Sub List1_AfterUpdate()
Me.RecordsetClone.FindFirst "[ID] = " & Me.List1
Me.Bookmark = Me.RecordsetClone.Bookmark
Me.ID.SetFocus
End Sub
 
A

Adnan

I wish there was a word bigger then ‘thank you’. Your code is just awesome!

Have a great day Rick.
Adnan :)



Rick Brandt said:
Adnan said:
I have a tab control on a bound form (Page 1, and Page 2), Page 1 has
data and page 2 has a list for search (displays same records as form
does). On double click, I need to find that record where the data are
(page 1) and set focus anywhere there, I tried the following but had
no luck.

DoCmd.GoToRecord acDataForm, "frmMain", acGoTo, "[ID] = " &
Me.List1 Me.ID.SetFocus

Sub List1_AfterUpdate()
Me.RecordsetClone.FindFirst "[ID] = " & Me.List1
Me.Bookmark = Me.RecordsetClone.Bookmark
Me.ID.SetFocus
End Sub
 
R

Rick Brandt

Adnan said:
I wish there was a word bigger then 'thank you'. Your code is just
awesome!

I appreciate the sentiment, but it's pretty standard stuff. Pretty much
exactly what the ComboBox wizard would have given you with the "Find
matching record" option. You are just using a ListBox instead of a
ComboBox.
 
Top