Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Programming

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 03-28-2010, 12:12 PM
greg_brockman greg_brockman is offline Windows 7 Access 2007 (version 12.0)
Novice
 
Join Date: Mar 2010
Location: Silicon Valley (SF Bay Area
Posts: 2
greg_brockman is on a distinguished road
Send a message via Yahoo to greg_brockman
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.
Reply With Quote
  #2  
Old 04-02-2010, 05:03 PM
llkhoutx llkhoutx is offline Windows Vista Access 2007 (version 12.0)
Expert
 
Join Date: Jan 2010
Location: Houston, Texas USA
Posts: 340
llkhoutx is on a distinguished road
Default

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.
Reply With Quote
  #3  
Old 04-03-2010, 10:02 PM
greg_brockman greg_brockman is offline Windows 7 Access 2007 (version 12.0)
Novice
 
Join Date: Mar 2010
Location: Silicon Valley (SF Bay Area
Posts: 2
greg_brockman is on a distinguished road
Send a message via Yahoo to greg_brockman
Default 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
Reply With Quote
  #4  
Old 04-04-2010, 04:12 PM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,322
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Would you like to follow the link in my sig and mark this thread as Solved?
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
Reply

Bookmarks

Tags
access 2007, data binding

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access2007 & Access2007Runtime? Yumin Access 2 03-22-2010 06:42 AM
Error Message in Access2007 Storm91 Access 3 02-18-2010 11:56 AM
Help in Access2007 Questions (MCAS) hegazy Access 6 12-15-2009 06:50 AM
Referring to objects stubbly Programming 1 10-14-2009 07:36 AM
query objects in VB6 genesis Access 1 07-10-2009 12:16 AM


All times are GMT -8. The time now is 01:24 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.