[AccessD] Editing default field content

A.D.Tejpal adtp at airtelbroadband.in
Fri Feb 1 01:19:23 CST 2008


John,

    My sample db named InputMask_Dynamic might be of interest to you. It is available at Rogers Access Library (other developers library). Link - http://www.rogersaccesslibrary.com/OtherLibraries.asp#Tejpal,A.D.
 
    On the main switchboard, third command button captioned "Text Fields - (Prefixed With Any Desired Text String)" should be pertinent to your needs. Clicking this button opens the form named F_ItemMaster. On this form, enter the desired prefix (say "AB00" as mentioned in your post) in the unbound text box named TxtPreFix, located just above the subform control.. 

    With this, you will find that the bound text box named ItemCode on the subform carries the desired prefix built into its input mask. At any stage, for changing the prefix, simply edit the contents of unbound text box on the main form.

    You could adapt the underlying approach suitably, for your specific needs.
 
Best wishes,
A.D.Tejpal
------------

  ----- Original Message ----- 
  From: John Clark 
  To: Access Developers discussion and problem solving 
  Sent: Friday, February 01, 2008 00:11
  Subject: [AccessD] Editing default field content


  I think this is a simple question, and I could swear I've done it before, but I am totally blank and can't get it myself...in my defense, I have been home w/my sick daughter all week, and I'm coming in today, to a pile of backed up voice mails and Email.
   
  I have a field that will...almost always...be in the format of AB00###
   
  When I enter the field, I want to avoid editing the whole field and be able to just pick up at the tail end of the default text of "AB00"
   
  I also want to be able to alter this text, in the event of a uncommon, but not totally rare, occurrence of a different structure.
   
  I seem to remember putting in some code for the OnGotFocus event, involving the length of the existing text, but I don't remember what I did, and I can't find it...it is probably in a long-since-replaced program, of old days.
   
  If it matters, I am using A2K3, but I originally did this...I do know...in A97.
   
  Thanks in advance. I haven't asked a question out here is a really long time, and now I am lowered to asking something simple...or should be as simple...as this ;o)
   
   
  John W. Clark
  Computer Programmer 
  Niagara County
  Central Data Processing


More information about the AccessD mailing list