A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do i set open form to current record?



 
 
Thread Tools Display Modes
  #1  
Old December 13th, 2009, 10:14 PM posted to microsoft.public.access.forms
acss
external usenet poster
 
Posts: 153
Default 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  
Old December 13th, 2009, 11:51 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default 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  
Old December 14th, 2009, 12:37 AM posted to microsoft.public.access.forms
ferde
external usenet poster
 
Posts: 141
Default 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  
Old December 14th, 2009, 12:42 AM posted to microsoft.public.access.forms
ferde
external usenet poster
 
Posts: 141
Default 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  
Old December 14th, 2009, 04:53 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default 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  
Old December 14th, 2009, 06:54 PM posted to microsoft.public.access.forms
acss
external usenet poster
 
Posts: 153
Default 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  
Old December 15th, 2009, 04:26 AM posted to microsoft.public.access.forms
ferde
external usenet poster
 
Posts: 141
Default 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  
Old December 15th, 2009, 03:45 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default 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  
Old December 16th, 2009, 03:21 PM posted to microsoft.public.access.forms
acss
external usenet poster
 
Posts: 153
Default 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  
Old December 16th, 2009, 04:18 PM posted to microsoft.public.access.forms
J_Goddard via AccessMonster.com
external usenet poster
 
Posts: 221
Default 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

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.