Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2010
    Location
    Silicon Valley (SF Bay Area
    Posts
    2

    Post Access2007 databound objects


    i developed a simple app to manage my movies. 4 command buttons manage first rec, prev rec, next rec and last rec. i used the access built in command button macros for each. following the pressing of last, for example, i would like to disable next and last buttons. simple enuf, right? well, the macro fires after the code event, so the record in the form still has the current rec, as opposed to the last rec, which leaves the buttons in their current state, though they should be disabled.
    how can i fix this without having to do all the work in code - bind the control in code.

  2. #2
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    You're not going to be able to easily do that with macros; the macro code is not trivial.

    I suggest that you get a good Access hornbook and step into VBA. You'll find that it is drammatically easier and more powerful than macros.

    You can search the various Access forums, for VBA code behind the buttons you have.

  3. #3
    Join Date
    Mar 2010
    Location
    Silicon Valley (SF Bay Area
    Posts
    2

    Databound controls

    thanks for your response. through a bit of digging, i learned that access is capable of converting macros to code, and after seeing the simplicity of the code, felt rather stupid for asking the quetion. here is an example of the code equivalent of the Next Record macro:Private Sub cmdNext_Click()
    On Error GoTo cmdNext_Click_Err
    DoCmd.GoToRecord , "", acNext
    'Manage form control states
    ButtonState
    cmdNext_Click_Exit:
    Exit Sub
    cmdNext_Click_Err:
    MsgBox Error$, Err.Number, Err.Source
    Resume cmdNext_Click_Exit
    End Sub

    unaware, i foolishly chose to trust the databinding and event sequence provided by access macros, instead or designing the simple code.
    the issue has long since been fixed.
    thanks.
    greg

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Would you like to follow the link in my sig and mark this thread as Solved?

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

Similar Threads

  1. Access2007 & Access2007Runtime?
    By Yumin in forum Access
    Replies: 2
    Last Post: 03-22-2010, 08:42 AM
  2. Error Message in Access2007
    By Storm91 in forum Access
    Replies: 3
    Last Post: 02-18-2010, 02:56 PM
  3. Help in Access2007 Questions (MCAS)
    By hegazy in forum Access
    Replies: 6
    Last Post: 12-15-2009, 09:50 AM
  4. Referring to objects
    By stubbly in forum Programming
    Replies: 1
    Last Post: 10-14-2009, 09:36 AM
  5. query objects in VB6
    By genesis in forum Access
    Replies: 1
    Last Post: 07-10-2009, 02:16 AM

Tags for this Thread

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