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  

Update Form with Command Button



 
 
Thread Tools Display Modes
  #1  
Old January 9th, 2010, 02:41 PM posted to microsoft.public.access.forms
RMires
external usenet poster
 
Posts: 41
Default Update Form with Command Button

I have a report which is created using criteria entered into a form. There is
already a button on the form which opens the report. If someone does not tab
out of a particular box then sometimes the the control isn't updated and the
report doesn't get the proper criteria. I can use the button to update all of
the individual controls before creating the form, but can I use the button to
update the entire form instead?
  #2  
Old January 9th, 2010, 03:18 PM posted to microsoft.public.access.forms
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default Update Form with Command Button

RMires,
Just do a...
Refresh
DoCmd.OpenReport... etc...
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"RMires" wrote in message
...
I have a report which is created using criteria entered into a form. There
is
already a button on the form which opens the report. If someone does not
tab
out of a particular box then sometimes the the control isn't updated and
the
report doesn't get the proper criteria. I can use the button to update all
of
the individual controls before creating the form, but can I use the button
to
update the entire form instead?



  #3  
Old January 9th, 2010, 08:23 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Update Form with Command Button

On Sat, 9 Jan 2010 06:41:01 -0800, RMires
wrote:

I have a report which is created using criteria entered into a form. There is
already a button on the form which opens the report. If someone does not tab
out of a particular box then sometimes the the control isn't updated and the
report doesn't get the proper criteria. I can use the button to update all of
the individual controls before creating the form, but can I use the button to
update the entire form instead?


The problem isn't that the textbox still has the focus - clicking the button
changes the focus, just as tabbing out would. The problem is probably that the
record is still on the form but not yet written to the table (to become
available for the report). If it's a bound form you can force a write to disk
using

If Me.Dirty Then Me.Dirty=False

in your button code.

--

John W. Vinson [MVP]
 




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 11:12 AM.


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