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

  • Thread starter Thread starter Adnan
  • Start date Start date
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
 
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
 
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
 
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.
 

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