Why would 'Got Focus' SelStart work in one form and not another?

Hargo

Registered User.
Local time
Today, 21:28
Joined
Sep 4, 2014
Messages
19
Hi bit of a newbie using Access 2013

I have several tables with Patient ID as Foreign Key related to a Patient table with Patient ID as Primary Key - the data type is set to text as the ID must have "SG" followed by a unique number 000148 for example

For the Patient ID controls in my data entry forms i want the cursor to start after the "SG" so have used SelStart = 2

This works fine in one or two forms, but not in others - so i guess my question is

What could interfere with the working of the code in one form from another?

When the control gets focus in some forms "SG" is highlighted, whilst in others the cursor blinks in the correct place after the "SG" - it's driving me mad!!:banghead:
 
In Access what you display and what you store are two different things (as opposed to Excel).

There is no reason to store an "SG" all over, since you can display a number with an"SG" prefix at will. Have your PatientID as number. For display you can always prepend "SG". For input people should not be forced to retype SG each type, whichyou sensibly attempted to avoid. Another way is using an input mask- google that. Finally, just can just show SG next to the input textbox asking for PatientID.
 

Users who are viewing this thread

Back
Top Bottom