![]() |
|
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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" |
|
| Bookmarks |
| Tags |
| access 2007, data binding |
| Thread Tools | |
| Display Modes | |
|
|
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 |