What's the event before moving to a next record on a form? I was hoping to update the form on the last moment the user moves away from it and moves to the next record.
What's the event before moving to a next record on a form? I was hoping to update the form on the last moment the user moves away from it and moves to the next record.
If you mean to set a "last updated by" type of field, typically done in the before update event.
Not sure what you mean.
User Bob clicks next record and as he does it saves all the details he entered into the unbound text fields before moving to the next record.
I'd like to make that happen...
Why unbound?
Try the form before update event or maybe the form after update event.
A record is committed to table when:
1. close form
2. move to another record
3. run code
Option 2 applies when user Bob clicks next record. If there were edits on the record then the BeforeUpdate and AfterUpdate events will fire. Code in the BeforeUpdate event can save data from the unbound controls.
I am also curious as to why the controls are unbound.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I coded an unbound to:A record is committed to table when:
1. close form
2. move to another record
3. run code
Option 2 applies when user Bob clicks next record. If there were edits on the record then the BeforeUpdate and AfterUpdate events will fire. Code in the BeforeUpdate event can save data from the unbound controls.
I am also curious as to why the controls are unbound.
pull the text into a field of tableA
pull in the ID of the record into a field in tableA
Time stamp into a field of tableA
Date stamp into a field of tableA
user stamp into a field of tableA
(VBA)
this way I can tract individual posts of the record from the users rather than using a memo field.
I also have a unbound textbox 2 that lists the records as one long string (with new lines between)
each record pulls the data and displays it in that unbound textbox 2 for the corresponding ID
In order for the user to enter data into the record using that unbound text box they have to press return. I would also like it if they don't happen to press return and just move to a another record
I don't understand why you couldn't do what you want with a bound form.
Date/time stamp could be achieved with default value Now.
Depending on How RecordId is calculated/assigned, it could be automated.
A login screen whereby User and privileges were determined could be used to update/assign User stamp to field.
Is this Form completely Unbound? Or are their merely some Controls on it that are Unbound?
If it is [B]completely Unbound, there really is no 'other Record' to move to, and I don't believe the normal Form events will ever fire. And note that there is nothing you've listed, in Post #7, that cannot be done using a Bound Form and it's Form_BeforeUpdate event, as suggested.
Linq ;0)>
To clarify - the form have unbound and unbound text boxes. I wanted the behaviour of a subform without having to use a subform so I made an unbound text box load the records of another table and another to enter in new data.Is this Form completely Unbound? Or are their merely some Controls on it that are Unbound?
If it is [B]completely Unbound, there really is no 'other Record' to move to, and I don't believe the normal Form events will ever fire. And note that there is nothing you've listed, in Post #7, that cannot be done using a Bound Form and it's Form_BeforeUpdate event, as suggested.
Linq ;0)>
It's when they haven't pressed return and move to the next record that I want an event to fire so that the data saves (almost like pressing enter as you click to next record on the next record icons at the bottom left of the form).
Some event must occur. Each control has BeforeUpdate and AfterUpdate events.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
This doesn't really clarify anything:
Did you actually mean:
If the Form is Bound, and I'm guessing, by the attached graphic showing an active Record-selector, then
Form Events, moving from one Record to another are
- Form_Current
- Form_BeforeUpdate
- Form_AfterUpdate
- Form_Current
Linq ;0)>
I come back to this one because it has come up again as an issue.This doesn't really clarify anything:
Did you actually mean:
If the Form is Bound, and I'm guessing, by the attached graphic showing an active Record-selector, then
Form Events, moving from one Record to another are
- Form_Current
- Form_BeforeUpdate
- Form_AfterUpdate
- Form_Current
Linq ;0)>
Currently to close a particular form (yes bound and unbound controls) I prevent the user from closing the form using the OnUnload which works great preventing the user from closing the form if certain fields have not yet been completed but this is only for when closing the form and not for moving to the next record when the form is in single form.
With the current event I check for things like if it is a theatre booking it changes colour, if the date is too old it locks etc etc etc etc
however I want to prevent the user moving from one record to the other without causing a conflict with my current event functions.