If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How do i set open form to current record?
I have a command button on the main form and when clicked a secondary form
opens however any data keyed in resets the main form back to record one. How do i set the second form entries to apply to the current record? |
#2
|
|||
|
|||
How do i set open form to current record?
I'm going to guess that you are requerying the mainform, so that it updates
from the data in the second form. Instead of Requery try Refresh when you go back to the main form. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "acss" wrote in message ... I have a command button on the main form and when clicked a secondary form opens however any data keyed in resets the main form back to record one. How do i set the second form entries to apply to the current record? |
#3
|
|||
|
|||
How do i set open form to current record?
"Arvin Meyer [MVP]" wrote: I'm going to guess that you are requerying the mainform, so that it updates from the data in the second form. Instead of Requery try Refresh when you go back to the main form. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "acss" wrote in message ... I have a command button on the main form and when clicked a secondary form opens however any data keyed in resets the main form back to record one. How do i set the second form entries to apply to the current record? . |
#4
|
|||
|
|||
How do i set open form to current record?
I'm having a similiar problem but I was hoping for help on getting my
mainform to open the second form on the same record number. I can get the second form to open but it always opens on record number one. Both forms are derived from the same table with the same "ID". I've been reading about using a "filter" and have tried it a number of times with no success. Any help would be appreciated "Arvin Meyer [MVP]" wrote: I'm going to guess that you are requerying the mainform, so that it updates from the data in the second form. Instead of Requery try Refresh when you go back to the main form. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "acss" wrote in message ... I have a command button on the main form and when clicked a secondary form opens however any data keyed in resets the main form back to record one. How do i set the second form entries to apply to the current record? . |
#5
|
|||
|
|||
How do i set open form to current record?
The code would be something like:
DoCmd.OpenForm "SecondFormName",,,"ID = " & Me.txtID That assumes that txtID is the name of the textbox holding the ID value. Remember, when you open another form to the exact same record there will be a locking conflict if you try to edit them both, so save the first form in the code immediately preceding the OpenForm code. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "ferde" wrote in message ... I'm having a similiar problem but I was hoping for help on getting my mainform to open the second form on the same record number. I can get the second form to open but it always opens on record number one. Both forms are derived from the same table with the same "ID". I've been reading about using a "filter" and have tried it a number of times with no success. Any help would be appreciated "Arvin Meyer [MVP]" wrote: I'm going to guess that you are requerying the mainform, so that it updates from the data in the second form. Instead of Requery try Refresh when you go back to the main form. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "acss" wrote in message ... I have a command button on the main form and when clicked a secondary form opens however any data keyed in resets the main form back to record one. How do i set the second form entries to apply to the current record? . |
#6
|
|||
|
|||
How do i set open form to current record?
Would there be additional code in additon to what you provided in order to
save first form data. In my case, i have the first form yet i need to add more fields but i do not want the form to be crowded. If i place a field on the main form it fills the table correctly so could you clarify on the usage of a second form for this purpose and if save data a needed option? Thanks "Arvin Meyer [MVP]" wrote: The code would be something like: DoCmd.OpenForm "SecondFormName",,,"ID = " & Me.txtID That assumes that txtID is the name of the textbox holding the ID value. Remember, when you open another form to the exact same record there will be a locking conflict if you try to edit them both, so save the first form in the code immediately preceding the OpenForm code. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "ferde" wrote in message ... I'm having a similiar problem but I was hoping for help on getting my mainform to open the second form on the same record number. I can get the second form to open but it always opens on record number one. Both forms are derived from the same table with the same "ID". I've been reading about using a "filter" and have tried it a number of times with no success. Any help would be appreciated "Arvin Meyer [MVP]" wrote: I'm going to guess that you are requerying the mainform, so that it updates from the data in the second form. Instead of Requery try Refresh when you go back to the main form. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "acss" wrote in message ... I have a command button on the main form and when clicked a secondary form opens however any data keyed in resets the main form back to record one. How do i set the second form entries to apply to the current record? . . |
#7
|
|||
|
|||
How do i set open form to current record?
Thank you for the help
"ferde" wrote: I'm having a similiar problem but I was hoping for help on getting my mainform to open the second form on the same record number. I can get the second form to open but it always opens on record number one. Both forms are derived from the same table with the same "ID". I've been reading about using a "filter" and have tried it a number of times with no success. Any help would be appreciated "Arvin Meyer [MVP]" wrote: I'm going to guess that you are requerying the mainform, so that it updates from the data in the second form. Instead of Requery try Refresh when you go back to the main form. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "acss" wrote in message ... I have a command button on the main form and when clicked a secondary form opens however any data keyed in resets the main form back to record one. How do i set the second form entries to apply to the current record? . |
#8
|
|||
|
|||
How do i set open form to current record?
Sure either use:
If Me.Dirty = True Then Me.Dirty = False which forces a save. Or the more conventional: DoCmd.RunCommand acCmdSaveRecord -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "acss" wrote in message ... Would there be additional code in additon to what you provided in order to save first form data. In my case, i have the first form yet i need to add more fields but i do not want the form to be crowded. If i place a field on the main form it fills the table correctly so could you clarify on the usage of a second form for this purpose and if save data a needed option? Thanks "Arvin Meyer [MVP]" wrote: The code would be something like: DoCmd.OpenForm "SecondFormName",,,"ID = " & Me.txtID That assumes that txtID is the name of the textbox holding the ID value. Remember, when you open another form to the exact same record there will be a locking conflict if you try to edit them both, so save the first form in the code immediately preceding the OpenForm code. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "ferde" wrote in message ... I'm having a similiar problem but I was hoping for help on getting my mainform to open the second form on the same record number. I can get the second form to open but it always opens on record number one. Both forms are derived from the same table with the same "ID". I've been reading about using a "filter" and have tried it a number of times with no success. Any help would be appreciated "Arvin Meyer [MVP]" wrote: I'm going to guess that you are requerying the mainform, so that it updates from the data in the second form. Instead of Requery try Refresh when you go back to the main form. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "acss" wrote in message ... I have a command button on the main form and when clicked a secondary form opens however any data keyed in resets the main form back to record one. How do i set the second form entries to apply to the current record? . . |
#9
|
|||
|
|||
How do i set open form to current record?
Thank you for the excellent help!!!
"ferde" wrote: Thank you for the help "ferde" wrote: I'm having a similiar problem but I was hoping for help on getting my mainform to open the second form on the same record number. I can get the second form to open but it always opens on record number one. Both forms are derived from the same table with the same "ID". I've been reading about using a "filter" and have tried it a number of times with no success. Any help would be appreciated "Arvin Meyer [MVP]" wrote: I'm going to guess that you are requerying the mainform, so that it updates from the data in the second form. Instead of Requery try Refresh when you go back to the main form. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "acss" wrote in message ... I have a command button on the main form and when clicked a secondary form opens however any data keyed in resets the main form back to record one. How do i set the second form entries to apply to the current record? . |
#10
|
|||
|
|||
How do i set open form to current record?
HI -
Have you looked into using a tab control on your form to hold all the required fields? By using a tab control you can put many more controls on the same form, without having them all visible at the same time. You might find by doing this you don't need a second form at all. John acss wrote: Would there be additional code in additon to what you provided in order to save first form data. In my case, i have the first form yet i need to add more fields but i do not want the form to be crowded. If i place a field on the main form it fills the table correctly so could you clarify on the usage of a second form for this purpose and if save data a needed option? Thanks The code would be something like: [quoted text clipped - 28 lines] . -- John Goddard Ottawa, ON Canada jrgoddard at cyberus dot ca Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|