Move Cursor To Next Field 'onchange' Etc..

Apr 17, 2005

I have 4 drop down lists calling values from a query.
This part works as expected.

However, I would like the focus to automatically change to the next drop down field after ANY (valid) entry is made.

IE

Drop Down 1: "any value" ----> focus automatically set to Drop Down 2, etc

The code I have only relates to 1 of the drop down values, I want it to rerlate to any of the values.

*************
Private Sub Question1_AfterUpdate()

If Me.Question1 = "Yes" Then
Me.Question2.SetFocus
End If
End Sub
*************

My values are simple, just "yes" "no" "I don't know", etc.

OR

If this cannot be done with drop downs, how about with field lists?

:cool:

View Replies


ADVERTISEMENT

Cursor To Beginning / End Of A Field

May 26, 2006

I have done a half-dozen searches and only gotten 1 option.

There is a simple way to have the cursor at the beginning or end of a field when it arrives in a new field.

I saw the VBA code aboyt setting the length. There is an easier, simpler way to set it so that you don't have to apply the vba code to every single indiviual field.

I remember learning about it here on this forum, but now can't find it.

Can anyone remember how to do this?

Thanks in advance,

View 2 Replies View Related

In A Subform, Unable To Stay With The Cursor On A Field.

Sep 1, 2006

When I try to edit fields in a subform the cursor always jumps to the first record's first field with a tab stop. I can not complete the modification and the cursor jumps back to the first record. When on the first record and on any other field the cursor will jump to the first field with tab stop.

I use Access 2003.

View 1 Replies View Related

Forms :: Set Focus - Sending Cursor To First Field

Dec 31, 2014

I have a form (Home_Interview_Form) with several subforms (AirFresheners, Pesticides1 etc), and I would like the cursor to move from the last field in one subform to the first field in the next subform on keydown. I have written the following code, but instead of sending the cursor to the first field (PestSpray) it is going to the next field (PestSprayCom) in the subform for some reason. I am using Access 2013.

Private Sub Fresh2React_KeyDown(KeyCode As Integer, Shift As Integer)
Forms!Home_Interview_Form!Pesticides1.SetFocus
Forms!Home_Interview_Form!Pesticides1.Form!PestSpr ay.SetFocus
End Sub

View 5 Replies View Related

Cursor To Left And All Caps In Code Field

Dec 14, 2014

I have a table with CODE number as text. (1234-11-3456). I also have this field in a subform. How do I get the field to start at left, and also make all CAPS. Also where do I do the input mask. In the Table or the Form where it is a subform?

View 4 Replies View Related

Forms :: Place Cursor At The End Of First Line In Memo Field

Dec 2, 2014

I have created a button that takes the contents of a memo field and adds a new line of text at the top with the date, time and initials of staff member. So far, so good...

However I want it to end with the cursor ready at the end of the first line (to type the note) The following code does everything but ends by putting the cursor right at the end of all of the text in the memo field (instead of the end of the first line):

Code:
Private Sub Command59_Click()
Me.Note = Format(Now, "d mmm yyyy hh:nn") & " - " & "(" & DLookup("[login]", "logintable") & ") " & Chr(13) & Chr(10) & Me.Note
Me.Note.SetFocus
Me.Note.SelStart = Len(Me.Note)
Me.Note.SelLength = 0
End Sub

View 6 Replies View Related

Forms :: Position The Cursor To The Beginning (left Side) Of The Field?

Apr 17, 2013

I have several comboxes where I'm using date/time input masks. When I go to enter data in the field the cursor is situated at the right end of the box. I have to backspace to the beginning of the field to enter the data. How do I position the cursor to the beginning (left side) of the field?

View 3 Replies View Related

How To Type In Number Value On Screen Field Without Having To Place Cursor At Beginning

Dec 5, 2013

I'm having trouble with a field on my DB. I have a field named zip code. It has a limit of 5 characters that are only number values, I'm not having any trouble with entering information at all, it's easiest when I just tab into the cell from the previous one. However, the part I am having trouble with is when I click within the field and the cursor, let's say, is at the second character line, and I enter the zipcode 15222, it'll only enter 1522 since my cursor is at the second line.

How can I fix this so that wherever my cursor is, within the box it'll type the full 5 digit zip code? My boss is insistent on making sure that even if he clicks towards the right of the box, it should type the full number.

View 6 Replies View Related

OnChange Or AfterUpdate

Feb 28, 2005

Is there a central reference on the net that explains the pro's and con's of each of the event types. I historically have used the OnChange event until the other day when someone suggested using the AfterUpdate instead.

Would like to ensure that I have the best event trigger being used where possible in various situations

Thanks in Advance

View 1 Replies View Related

Forms :: Move Focus From Last Field Of Subform To Another Field On Main Form

Aug 19, 2015

I am currently stuck on set focus property. I have a main from with nested subform. I am trying to move the focus from last field of the subform to another field on the main form.

Customers(mfrm)....>Addresses(sfrm)...>Orders(sfrm Add)......>OrdDetails(sfrmOrders)

Now I have a field name [Securedesign] in frmOrderdetails and I want the tab order to navigate to field [CustomerID] in frmAddresses which is a subform to frmCustomers.

View 2 Replies View Related

Forms :: Create Button To Enter Current Date / Time In Field Where Cursor Is Presently Placed

Jan 14, 2014

Looking to create two command buttons or two keystrokes sets in an Access 2007 form that will allow me to place a current date and time in any allowable field where the Cursor is presently placed. Similar to what was in Access 2000, ctl: (for the current date) and ctl shift : (for the current time).

View 2 Replies View Related

Forms :: Move From Last Field In Form To New Record Field On First Page

Aug 27, 2014

What is the best way to move from the last field on the last page of a form to a new record field on the first page?

View 5 Replies View Related

OnChange Triggered Before Change In Value

May 30, 2005

I have a combobox which needs to call a function f(combobox.value) during its onChange event. Currently though, combobox.value appears not to change before the onChange event, and so the function receives the wrong (last) value.

Note - the actual text in the text field of the combobox *has* changed to the new value before the onChange event occurs.

Any ideas why this might be?

Edit - Also the problem doesn't happen when selecting with the mouse, only when using the up and down arrow keys to move through the list.

View 3 Replies View Related

AfterUpdate Or OnChange For A Bound Textbox

Jun 1, 2006

Hi there,

I'd like to call a function when a bound textbox is updated and for some reasons it doesn't seem to work. It works when the textbox is unbound (or maybe I missed something)
Here is a very simplified version of the form:
http://img207.imageshack.us/img207/3618/apf4ax.jpg

MyFunction() is just a MsgBox for now and I'd like it to appear when the textbox in the main form is updated (i.e. when the text in the subform is updated). I set .AfterUpdate= "=MyFunction()" and .OnChange="=MyFunction()" but nothing happens.
(see attached code)

Thank you in advance !

View 2 Replies View Related

Separate OnChange And AfterInsert Events

Jul 12, 2006

I use the events afterInsert of a Form frmA and the onChange of a field in the same form in order to make some changes to another Form frmB.

Everything goes as expected when the field (with the onChange event assigned) of an existing record changes.
The problem starts when I add a new record which triggers both AfterInsert event (desired) and onChage event (undesired).

Is there a trick to separate the two events?
Basically I want to call a Sub when the data on the field change (onChange)
and a different Sub when I add a new record (AfterInsert).

Thanks in advance

View 11 Replies View Related

Forms :: Default Value In Onchange Event

Jan 27, 2014

On my form i have a control called WeekDate (this is always the start of the week (monday), below i have a subform (sbfrmWorksheetDetails) contained in a tab control (tabWeek) with 5 pages for each day of the week, i have written a select case statement in the onchange event for tabWeek which selects records based on the day of the week (so = WeekDate for Monday, +1 for Tuesday, +2 for Wednesday etc), this works great, i have also put a bit of code in the same onchange event that makes the default value for a new record for the field WorkDayDate in the subform +1 and +2 etc. this works great for existing records, each new line in the subform puts the right date in, however this seems to cock up when clicking on a new tab that doesn't have a record in..Here's the code.

Private Sub tabWeek_Change()
Select Case tabWeek
Case 0 'Monday
Forms!WeeklyWorksheet!sbfrmWorksheetDetails.Form.R ecordSource = "SELECT * FROM tblWorksheetDetails WHERE (((tblWorksheetDetails.WorkDayDate) = [Forms]![WeeklyWorksheet]![WorksheetDate]))"
Forms!WeeklyWorksheet!sbfrmWorksheetDetails.Form!W orkDayDate.DefaultValue = SQLDate(Me.WorksheetDate)
Case 1 'Tuesday
Same as above but WorksheetDate+ 1 for both select and default value.
Case 2 'Wednesday
Same but +2 etc.
End Select
End Sub

the SQLDate is some code that converts the american US date formatting to UK formatting. i'm not sure if that's the problem, but i'll post that anyway:

Function SQLDate(vDate As Variant) As String
If IsDate(vDate) Then
SQLDate = "#" & Format$(vDate, "dd/mm/yyyy") & "#"
End If
End Function

I can't quite work out what screwing this up upon adding a new record.

View 14 Replies View Related

Forms :: OnChange Event - Setting Password Protection On Tab Control

Nov 4, 2013

I have an Access 2010 form within my database in which I have a series of 8 tabs on a tab control. I am the only user who will have access to these tabs. I want to require a password in order to permit access to the tabs. The very first tab on the tab control works as a cover tab. There is no relevant information for anyone to view...only a graphic.

How to code the "on change" event of the tab control.

View 1 Replies View Related

Move Text From One Field To Another Automatically

Jun 28, 2006

Hi, I have a form set up, among other fields in the form is a Weekly update
free form field. I have another field called Historical Weekly updates. What
I want to happen is that when a user clicks in the Weekly updae field, the
text that is in there should pop down to the Historical field and have the
date of the move post next to the text in the historical field. I have no idea if this is a click action, a macro, or if it's even possible.Any help would be greatly appreciated!!


Thanks!!!

View 5 Replies View Related

Form - Move To A Field With New Record

Mar 16, 2005

I have a form we use for data entry, and not all the fields willhave data in them. When we click the new record button the cursor stays in the field where it was for the last record. We would like the cursor to move to the first field on the form everytime a new record is started.
Can anyone help me out here??

Thanks
Becky

View 8 Replies View Related

Move Data From One Field To Another Within A Table.

Nov 21, 2006

Hello. My question is how do I go about moving data from one field to another within a table? I want to move the data in ReportDateClo to ReportDatCom when both ReportDateClo and SupAct are true by record which are identified by the field LogNum. It is probably very simple but I am having a brain cramp.

ReportDateClo and ReportDatCom are "short date" date fields. SupAct is a Yes/No field. LogNum is an autonumber.

View 2 Replies View Related

Forms :: Control Move On Next Field

Feb 7, 2014

I have a form containing these fields

trantype,Damount, Camount,Description

And trantype look-up field containing transaction type debit or credit.

Here in this form i want when i select debit transaction type then control move to the Damount and on pressing Enter key Camount skip and control move on Description, and same like this when i choose transaction type Credit then Damount skip away and control move on Camount field and next to description, and access doesn't ask for enter value in Damount.

View 4 Replies View Related

Modules & VBA :: Move Field On Tabbed Form

Sep 11, 2014

If I have a field in a tabbed form (the form has pages), can this field be moved from a tab to another programatically?

The form is called "ProjectMain". The field is called "Lenght" and the page (form tab) it is on is "specs1". Sometimes I need to have this field in the page (form tab) "specs2"

View 3 Replies View Related

How Do I Create A Query To Move 2 Fields On The Same Row To Be 2 Rows In One Field

Jun 6, 2007

Hello,
I have a big table like this:
ID Name Race1 Race2 Race3
-- ---- ----- ----- -----
1 a Asian russian

How do I create a query to be like this (either in query or report)?
I like to combine three fields (race1, race2, race3) in one field (Race), and break any value of races to the 2nd line, 3rd line, if there is a value...
ID Name Race
-- --- ----
1 a Asian
Russian

In Oracle and SQL Server, we can combine a few rows to be columns-like, but in Access, is there any way to do that? and how?

Thanks so much!

Jenny.

View 1 Replies View Related

General :: Making A Form Button That Will Act As TAB- Move From Field To Field In The Form?

Jun 12, 2013

I made a form for use in touch screen app. I would like to make a form button that will act as TAB- move from field to field in the form.

View 4 Replies View Related

Forms :: Save Form Record On Move To Next Field In Record?

Jan 15, 2014

After I enter data into one field in a record I would like the form to save the record when I move to another field in the same record. It seems that the record is only saved when I exit it entirely. Is there a way to save a record when moving between fields in that record? Can this be done without using an Event Procedure for each field?

View 8 Replies View Related

Changing Cursor

Nov 26, 2005

Is there any whay you can change the cursor as it moves over an object, similar to what it does with hyperlink.

I am trying to make the form more dynamic

Thanks

Dave

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved