Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / November 2007

Tip: Looking for answers? Try searching our database.

On-Click Event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dee - 05 Nov 2007 18:47 GMT
I am running this event from a control on a sub-form that refers to another
sub-form.  (I have a main form, subform and subform)

The innermost subform is in Datasheet view.  This code does what I want, but
it open the sub-form in a separate window.  I'd like to modify it so that it
simply either display not found message (no problem there) or displays the
row that matches the search criterion in the datasheet view of the subform,
with the cursor flashing on that row.

Here is my code:

Private Sub Command26_Click()
On Error GoTo Err_Command26_Click

   Dim stDocName As String
   Dim stLinkCriteria As String

   stDocName = "frm_ppt_search"
   DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command26_Click:
   Exit Sub

Err_Command26_Click:
   MsgBox Err.Description
   Resume Exit_Command26_Click
   
End Sub

Any help would be great!
Signature

Thanks!

Dee

heifler - 09 Nov 2007 21:11 GMT
Dee,
You set the record source of the  datasheet view of the subform to a query
that has as it's criteria the record id of the record you want to show.
This can be done by referencing a control containing that id.  You can
reference it by right clicking in the query criteria cell of the record id
column and selecting build.  Then find the subform and then the control
containing the record id value. Have the event you currently have simple set
the record source of the subform to the query mentioned above.
bob

>I am running this event from a control on a sub-form that refers to another
>sub-form.  (I have a main form, subform and subform)
[quoted text clipped - 26 lines]
>
>Any help would be great!

Signature

Bob Heifler
My Access Program, Owner
www.myaccessprogram.com
info (At) MyAccessProgram (Dot) com

dee - 10 Nov 2007 00:07 GMT
Thanks so much for your response.  I came up with another solution, but will
try this out over the weekend for future reference.

Signature

Thanks!

Dee

> Dee,
> You set the record source of the  datasheet view of the subform to a query
[quoted text clipped - 36 lines]
> >
> >Any help would be great!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.