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  

form event properties



 
 
Thread Tools Display Modes
  #1  
Old August 16th, 2005, 10:43 PM
J@50N-5ALTR
external usenet poster
 
Posts: n/a
Default form event properties

I have a small problem that occurs when printing a report. I use the find
file (CTRL+ F) feature to locate a file that I wish to print, and must have
the searchable field selected when I do this search. Once I have closed the
preview window of the report, I want the form to reset the cursor to the same
field as before. The cursor appears in none of the fields when I return to
the form. Is there an event property of the form that I can reset the cursor
position without selecting the field by hand?
I appreciate any guidance with this matter.

  #2  
Old August 17th, 2005, 12:41 AM
tina
external usenet poster
 
Posts: n/a
Default

you might try adding code to the form's Activiate event procedure, as

Me!MyControlName.SetFocus

substitute the name of the control on your form.

hth


"J@50N-5ALTR" wrote in message
...
I have a small problem that occurs when printing a report. I use the find
file (CTRL+ F) feature to locate a file that I wish to print, and must

have
the searchable field selected when I do this search. Once I have closed

the
preview window of the report, I want the form to reset the cursor to the

same
field as before. The cursor appears in none of the fields when I return to
the form. Is there an event property of the form that I can reset the

cursor
position without selecting the field by hand?
I appreciate any guidance with this matter.



  #3  
Old August 17th, 2005, 09:15 PM
J@50N-5ALTR
external usenet poster
 
Posts: n/a
Default

Hi tina,
I am a true neophyte when Visual Basic is concerned. If my form's name is
"mainEquipment Information" then how do I write the code that you gave me.
When I wrote the code an error said that the command "Private Sub
Form_Activate()" would stop the debugger, but I wrote it in the form's
Activate event procedure as you suggested. If I am off base, please point me
in the proper direction. Thanks

"tina" wrote:

you might try adding code to the form's Activiate event procedure, as

Me!MyControlName.SetFocus

substitute the name of the control on your form.

hth


"J@50N-5ALTR" wrote in message
...
I have a small problem that occurs when printing a report. I use the find
file (CTRL+ F) feature to locate a file that I wish to print, and must

have
the searchable field selected when I do this search. Once I have closed

the
preview window of the report, I want the form to reset the cursor to the

same
field as before. The cursor appears in none of the fields when I return to
the form. Is there an event property of the form that I can reset the

cursor
position without selecting the field by hand?
I appreciate any guidance with this matter.




  #4  
Old August 17th, 2005, 10:12 PM
tina
external usenet poster
 
Posts: n/a
Default

did you put the code in the [mainEquipment Information] form's event
*procedure* in the VBA Editor window? or did you put it right on the On
Activate property line in the Properties box of the form design view?


"J@50N-5ALTR" wrote in message
news
Hi tina,
I am a true neophyte when Visual Basic is concerned. If my form's name is
"mainEquipment Information" then how do I write the code that you gave me.
When I wrote the code an error said that the command "Private Sub
Form_Activate()" would stop the debugger, but I wrote it in the form's
Activate event procedure as you suggested. If I am off base, please point

me
in the proper direction. Thanks

"tina" wrote:

you might try adding code to the form's Activiate event procedure, as

Me!MyControlName.SetFocus

substitute the name of the control on your form.

hth


"J@50N-5ALTR" wrote in message
...
I have a small problem that occurs when printing a report. I use the

find
file (CTRL+ F) feature to locate a file that I wish to print, and must

have
the searchable field selected when I do this search. Once I have

closed
the
preview window of the report, I want the form to reset the cursor to

the
same
field as before. The cursor appears in none of the fields when I

return to
the form. Is there an event property of the form that I can reset the

cursor
position without selecting the field by hand?
I appreciate any guidance with this matter.






  #5  
Old August 18th, 2005, 04:20 PM
J@50N-5ALTR
external usenet poster
 
Posts: n/a
Default

I did put the code in the [mainEquipment Information] form's event
*procedure* in the VBA Editor window but I accessed the event procedure
through the Properties box of the form design view. In short I selected the
Activate property line then chose *event procedure* from a drop-down menu. I
then clicked on the "..." button to access the VBA Editor window and there I
added your line of code. What do I need to do next?

"tina" wrote:

did you put the code in the [mainEquipment Information] form's event
*procedure* in the VBA Editor window? or did you put it right on the On
Activate property line in the Properties box of the form design view?


"J@50N-5ALTR" wrote in message
news
Hi tina,
I am a true neophyte when Visual Basic is concerned. If my form's name is
"mainEquipment Information" then how do I write the code that you gave me.
When I wrote the code an error said that the command "Private Sub
Form_Activate()" would stop the debugger, but I wrote it in the form's
Activate event procedure as you suggested. If I am off base, please point

me
in the proper direction. Thanks

"tina" wrote:

you might try adding code to the form's Activiate event procedure, as

Me!MyControlName.SetFocus

substitute the name of the control on your form.

hth


"J@50N-5ALTR" wrote in message
...
I have a small problem that occurs when printing a report. I use the

find
file (CTRL+ F) feature to locate a file that I wish to print, and must
have
the searchable field selected when I do this search. Once I have

closed
the
preview window of the report, I want the form to reset the cursor to

the
same
field as before. The cursor appears in none of the fields when I

return to
the form. Is there an event property of the form that I can reset the
cursor
position without selecting the field by hand?
I appreciate any guidance with this matter.


  #6  
Old August 18th, 2005, 08:10 PM
tina
external usenet poster
 
Posts: n/a
Default

well, you did it exactly right (i had to ask; sometimes folks unfamiliar
with VBA will put code right on the event line in the Properties box). as
for the error message,

When I wrote the code an error said that the command "Private Sub
Form_Activate()" would stop the debugger


i haven't a clue why you would get such an error message. did you get the
error message when you tried out your process with the code in place? if
not, run through your process and see if the Activate code provides the
result you want. if it doesn't, maybe we can come up with another solution.

hth


"J@50N-5ALTR" wrote in message
...
I did put the code in the [mainEquipment Information] form's event
*procedure* in the VBA Editor window but I accessed the event procedure
through the Properties box of the form design view. In short I selected

the
Activate property line then chose *event procedure* from a drop-down menu.

I
then clicked on the "..." button to access the VBA Editor window and there

I
added your line of code. What do I need to do next?

"tina" wrote:

did you put the code in the [mainEquipment Information] form's event
*procedure* in the VBA Editor window? or did you put it right on the On
Activate property line in the Properties box of the form design view?


"J@50N-5ALTR" wrote in message
news
Hi tina,
I am a true neophyte when Visual Basic is concerned. If my form's name

is
"mainEquipment Information" then how do I write the code that you gave

me.
When I wrote the code an error said that the command "Private Sub
Form_Activate()" would stop the debugger, but I wrote it in the form's
Activate event procedure as you suggested. If I am off base, please

point
me
in the proper direction. Thanks

"tina" wrote:

you might try adding code to the form's Activiate event procedure,

as

Me!MyControlName.SetFocus

substitute the name of the control on your form.

hth


"J@50N-5ALTR" wrote in message
...
I have a small problem that occurs when printing a report. I use

the
find
file (CTRL+ F) feature to locate a file that I wish to print, and

must
have
the searchable field selected when I do this search. Once I have

closed
the
preview window of the report, I want the form to reset the cursor

to
the
same
field as before. The cursor appears in none of the fields when I

return to
the form. Is there an event property of the form that I can reset

the
cursor
position without selecting the field by hand?
I appreciate any guidance with this matter.




  #7  
Old August 18th, 2005, 09:08 PM
J@50N-5ALTR
external usenet poster
 
Posts: n/a
Default

Tina,
Thanks for all your help; my understanding of VB is a bit more substantial.
If any one else might have some insight about how this command "Private Sub
Form_Activate()" will stop the debugger" could be corrected it would help
matters so much. The command line turned yellow with a yellow arrow next to
it, if that will shed some light on matters. I also need to know where to add
the form's name *Form_Equipment_Information* to the Activate command
*Me!MyControlName.SetFocus*.




  #8  
Old August 19th, 2005, 02:00 AM
tina
external usenet poster
 
Posts: n/a
Default

you're putting the code in the module of form *Form_Equipment_Information*.
so the Me keyword refers to that form - you don't need to refer to it
explicitly. substitute the name of an actual control on your form, in place
of MyControlName.

hth


"J@50N-5ALTR" wrote in message
...
Tina,
Thanks for all your help; my understanding of VB is a bit more

substantial.
If any one else might have some insight about how this command "Private

Sub
Form_Activate()" will stop the debugger" could be corrected it would help
matters so much. The command line turned yellow with a yellow arrow next

to
it, if that will shed some light on matters. I also need to know where to

add
the form's name *Form_Equipment_Information* to the Activate command
*Me!MyControlName.SetFocus*.






  #9  
Old August 19th, 2005, 04:48 PM
J@50N-5ALTR
external usenet poster
 
Posts: n/a
Default

Great news, the form resets the cursor to the field that I wish once I close
the preview window to activate the form window. I don't get the same effect
when I print a report since no preview window opens. How do I reset the
cursor to the desired field while the form is still active? Thanks for the
help.

"tina" wrote:

you're putting the code in the module of form *Form_Equipment_Information*.
so the Me keyword refers to that form - you don't need to refer to it
explicitly. substitute the name of an actual control on your form, in place
of MyControlName.

hth


"J@50N-5ALTR" wrote in message
...
Tina,
Thanks for all your help; my understanding of VB is a bit more

substantial.
If any one else might have some insight about how this command "Private

Sub
Form_Activate()" will stop the debugger" could be corrected it would help
matters so much. The command line turned yellow with a yellow arrow next

to
it, if that will shed some light on matters. I also need to know where to

add
the form's name *Form_Equipment_Information* to the Activate command
*Me!MyControlName.SetFocus*.







  #10  
Old August 19th, 2005, 08:37 PM
tina
external usenet poster
 
Posts: n/a
Default

are you printing the report by clicking a command button on the form, that
has code behind it? if so, add the same "SetFocus" line of code to the
command button's procedure, after the OpenReport action.

hth


"J@50N-5ALTR" wrote in message
...
Great news, the form resets the cursor to the field that I wish once I

close
the preview window to activate the form window. I don't get the same

effect
when I print a report since no preview window opens. How do I reset the
cursor to the desired field while the form is still active? Thanks for the
help.

"tina" wrote:

you're putting the code in the module of form

*Form_Equipment_Information*.
so the Me keyword refers to that form - you don't need to refer to it
explicitly. substitute the name of an actual control on your form, in

place
of MyControlName.

hth


"J@50N-5ALTR" wrote in message
...
Tina,
Thanks for all your help; my understanding of VB is a bit more

substantial.
If any one else might have some insight about how this command

"Private
Sub
Form_Activate()" will stop the debugger" could be corrected it would

help
matters so much. The command line turned yellow with a yellow arrow

next
to
it, if that will shed some light on matters. I also need to know where

to
add
the form's name *Form_Equipment_Information* to the Activate command
*Me!MyControlName.SetFocus*.









 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Requerying a pop up form to display in the main form Jennifer P Using Forms 13 April 5th, 2005 06:59 PM
Design help, please SillySally Using Forms 27 March 6th, 2005 04:11 AM
Cursor Positioning Colin Hammond General Discussion 3 November 2nd, 2004 08:42 PM
auto entry into second table after update Tony New Users 13 July 9th, 2004 10:42 PM
synchronizing form and list box Deb Smith Using Forms 8 June 21st, 2004 08:15 PM


All times are GMT +1. The time now is 11:36 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.