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 TO MOVE FOCUS TO ANOTHER FIELD IN A FORM



 
 
Thread Tools Display Modes
  #1  
Old January 27th, 2010, 11:46 AM posted to microsoft.public.access.forms
DVANANTHAN
external usenet poster
 
Posts: 1
Default HOW TO MOVE FOCUS TO ANOTHER FIELD IN A FORM

dear sir

I am a middle aged retired man and I am trying to learn MSaccess2007 . I
have created a small database and i am trying to create a data entry form. In
the form i want to move from one field to another depending on the value
entered in a particular field. For example i have a field called "Doc Type"-
If i enter the value" Cashsheet" , then it should move to a field called
"Week Number" other wise it should skip this"week Number" field and go to
the next "Details of DOC" field. Please note that the Week "Number filed"
should normally be locked and should be opened for data entry only if
"DocType" is Cashsheet. Is it possible?

I do not know visual basic and would like to use the wizard , expression
builder etc.. available in ms access.

  #2  
Old January 27th, 2010, 02:31 PM posted to microsoft.public.access.forms
Daryl S[_2_]
external usenet poster
 
Posts: 881
Default HOW TO MOVE FOCUS TO ANOTHER FIELD IN A FORM

Dvananthan -

Yes, this is possible. You want to set enabled property for the "Week
Number" control to "No". This will mean the cursor will not go into that
field, and the user cannot update it.

Then you need to put some code in the AfterUpdate event of the control for
the "Doc Type". The code will look like this:
If Me.[Doc Type] = "Cashsheet" Then
Me.[Week Number].Enabled = True
Else
Me.[Week Number].Enabled = False
End If

The "Me." construct tells Access we are talking about the current form, so
the code above must reference the control names, not the field names.

Hope that helps!
--
Daryl S


"DVANANTHAN" wrote:

dear sir

I am a middle aged retired man and I am trying to learn MSaccess2007 . I
have created a small database and i am trying to create a data entry form. In
the form i want to move from one field to another depending on the value
entered in a particular field. For example i have a field called "Doc Type"-
If i enter the value" Cashsheet" , then it should move to a field called
"Week Number" other wise it should skip this"week Number" field and go to
the next "Details of DOC" field. Please note that the Week "Number filed"
should normally be locked and should be opened for data entry only if
"DocType" is Cashsheet. Is it possible?

I do not know visual basic and would like to use the wizard , expression
builder etc.. available in ms access.

 




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:08 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.