self-selecting fields in a data access page not working in Access 2003

  • Thread starter Cap'n Dave via AccessMonster.com
  • Start date
C

Cap'n Dave via AccessMonster.com

I received this info from Programming Data Acess Pages (Microsoft Acess 2000
Technical Articles)
http://msdn.microsoft.com/library/en-us/dnacc2k/html/programdap.asp?frame=true
.. It is not working using Access 2003! Can anyone suggest how to do this?

Self-Selecting Fields
When the user tabs into a field in a form, the contents of the field are
selected. If you'd like this same behavior in your data access pages, you can
add the following script to each text field (substitute the actual field name
for Field below).

<SCRIPT for=Field event=onfocus language=vbscript>
Field.select
</SCRIPT>

Thanks for your help.
 
C

Cap'n Dave via AccessMonster.com

The problem is for the dropdown controls. These controls are represented
using the <SELECT> tag in HTML which does not support the .select method.
Dropdown controls have data selected when the user tabs into them so you
shouldn't need this code.

Regarding the other code. You can use the following code in the Current event
of the MSODSC to move to myField:

Code:
------------------------------------------------------------------------------
--

<SCRIPT language=vbscript event=Current(dscei) for=MSODSC>
<!--
' SetFocus to myField
myField.focus
-->
</SCRIPT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top