Results 1 to 7 of 7
  1. #1
    Evgeny's Avatar
    Evgeny is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    85

    Datasheet View

    I have Customer Form with Building subfrom with few buttons, which open up additional information about the building. It works fine in the single form view, but i would like to have my Building subform running as datasheet and use the same buttons to view additional information, however i dont seem to make it work. Here is the example code of one of the buttons:



    This function opens up an Asset Register for particular building:

    Private Sub cmdViewAsset_Click()


    DoCmd.RunCommand acCmdSaveRecord

    If Not IsNull(Me.txtBuildingID) Then

    DoCmd.OpenForm "BuildingAssets", , , "BuildingID = " & Me.txtBuildingID

    Else

    MsgBox ("No Building Selected")


    End If

    It works with single form view, i guess i just need extra code to make it select the building from the datasheet, but i dont have sufficient vba knowledge to make it work.

    any help would be much appreciated

    regards

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    How does it not work? Typically you'd need a button in the detail section of a form in continuous view, or use the double click event of one of the textboxes in datasheet view.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Evgeny's Avatar
    Evgeny is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    85
    hm... OnClick event works, but what if i want to view different forms based on this record? Can you fill me in a bit more, i am little bit confused about continuous view

  4. #4
    Evgeny's Avatar
    Evgeny is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    85
    i see what you mean, sorry it was dumb of me . . .

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Got it working now? I prefer continuous view because I feel like I have more control over the look.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Evgeny's Avatar
    Evgeny is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    85
    hm . .. i am getting an error .. actually two of them, first when i add another building and second when i click on BuildingInfo button. I have attached the pics. I am really confused now

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Searching at MS I find a couple of KB's on that:

    http://support.microsoft.com/kb/907337

    http://support.microsoft.com/kb/295824
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Missing Columns in Datasheet View
    By mikel in forum Access
    Replies: 3
    Last Post: 01-02-2015, 01:57 PM
  2. synch 2 combo boxes in datasheet view
    By kapplers in forum Forms
    Replies: 2
    Last Post: 11-09-2009, 09:09 AM
  3. datasheet view adding fields drop-down box
    By techexpressinc in forum Access
    Replies: 2
    Last Post: 09-09-2009, 05:35 AM
  4. refresh datasheet as text changes
    By mkhan in forum Forms
    Replies: 0
    Last Post: 09-06-2008, 07:46 AM
  5. Form - Datasheet View
    By kalove in forum Forms
    Replies: 0
    Last Post: 06-20-2007, 11:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums